-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (44 loc) · 2.29 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Release
on:
workflow_dispatch:
inputs:
component:
description: 'Version component to increment (Use *minor* unless we have breaking changes)'
required: true
type: choice
options:
- minor
- major
jobs:
release-new-version:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event.inputs.component != ''
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: echo Version Component to Increase is ${{ github.event.inputs.component }}
- name: get next version number
run: .github/workflows/bump.py ${{ github.event.inputs.component }}
id: bump
- run: echo New version number ${{ steps.bump.outputs.newVersion }}
- name: tag container image
run: |
SHA=$(git rev-parse HEAD)
podman login -u token -p ${{ github.token }} ghcr.io
podman pull ghcr.io/${{ github.repository }}:amd64-"$SHA"
podman pull ghcr.io/${{ github.repository }}:arm64-"$SHA"
podman manifest create ghcr.io/${{ github.repository }}:${{ steps.bump.outputs.newVersion }}
podman manifest add ghcr.io/${{ github.repository }}:${{ steps.bump.outputs.newVersion }} ghcr.io/${{ github.repository }}:amd64-"$SHA"
podman manifest add ghcr.io/${{ github.repository }}:${{ steps.bump.outputs.newVersion }} ghcr.io/${{ github.repository }}:arm64-"$SHA"
podman push ghcr.io/${{ github.repository }}:${{ steps.bump.outputs.newVersion }}
sed -i 's|container_image=localhost/builder|container_image=ghcr.io/${{ github.repository }}:${{ steps.bump.outputs.newVersion }}|' build
- name: git tag
run: |
git tag ${{ steps.bump.outputs.newVersion }}
git push origin ${{ steps.bump.outputs.newVersion }}
- name: create release (new version)
run: |
release="$(.github/workflows/release.sh ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} create ${{ steps.bump.outputs.newVersion }} "Builder (${{ steps.bump.outputs.newVersion }})")"
.github/workflows/release.sh ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} upload "$release" build
.github/workflows/release.sh ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} upload "$release" build.config