@@ -13,45 +13,93 @@ jobs:
1313 id-token : " write"
1414 packages : " write"
1515 name : release
16- runs-on : ubuntu-22 .04
16+ runs-on : ubuntu-24 .04
1717 outputs :
1818 tag_name : ${{ steps.draft_release.outputs.tag_name }}
1919 steps :
20- - name : Checkout action code
21- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
20+ - name : Checkout
21+ uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2222 with :
2323 fetch-depth : 0
2424
2525 - name : Create GitHub App Token
2626 id : app-token
27- uses : actions/create-github-app-token@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4 # v1.10.3
27+ uses : actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
2828 with :
2929 app-id : ${{ secrets.VERSION_CLI_UPDATER_APP_ID }}
3030 private-key : ${{ secrets.VERSION_CLI_UPDATER_PRIVATE_KEY }}
3131
3232 - name : Draft release
3333 id : draft_release
34- uses : release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # v6.0 .0
34+ uses : release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1 .0
3535 with :
3636 disable-autolabeler : true
3737 env :
3838 GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
3939
40+ - name : Set up QEMU
41+ uses : docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
4042 - name : Set up Docker Buildx
41- uses : docker/setup-buildx-action@aa33708b10e362ff993539393ff100fa93ed6a27 # v3.5.0
43+ uses : docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
44+ - name : Get current date
45+ id : date
46+ run : echo "date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
47+ - name : Extract base image info
48+ id : base_image
49+ run : |
50+ BASE_IMAGE_FULL=$(grep -i '^FROM' Dockerfile | tail -n 1 | awk '{print $2}')
51+ if [[ "$BASE_IMAGE_FULL" == "scratch" ]]; then
52+ echo "name=scratch" >> $GITHUB_OUTPUT
53+ echo "digest=" >> $GITHUB_OUTPUT
54+ else
55+ echo "name=$(echo "$BASE_IMAGE_FULL" | cut -d'@' -f1)" >> $GITHUB_OUTPUT
56+ echo "digest=$(echo "$BASE_IMAGE_FULL" | cut -d'@' -f2)" >> $GITHUB_OUTPUT
57+ fi
4258
4359 - name : Login to GitHub Container Registry
44- uses : docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3 .0
60+ uses : docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6 .0
4561 with :
4662 registry : ghcr.io
4763 username : ${{ github.actor }}
4864 password : ${{ secrets.GITHUB_TOKEN }}
4965
5066 - name : Build Docker image
51- run : VERSION=${{ steps.draft_release.outputs.tag_name }} make docker-push
67+ uses : docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
68+ with :
69+ context : .
70+ platforms : |
71+ linux/amd64
72+ linux/arm64
73+ linux/arm/v8
74+ linux/ppc64le
75+ linux/arm/v7
76+ push : true
77+ tags : |
78+ ghcr.io/version-cli/version:latest
79+ ghcr.io/version-cli/version:${{ steps.draft_release.outputs.tag_name }}
80+ labels : |
81+ authors=Koen van Zuijlen <8818390+kvanzuijlen@users.noreply.github.com>
82+ org.opencontainers.image.created=${{ steps.date.outputs.date }}
83+ org.opencontainers.image.authors=Koen van Zuijlen <8818390+kvanzuijlen@users.noreply.github.com>
84+ org.opencontainers.image.url=${{ github.event.repository.html_url }}
85+ org.opencontainers.image.documentation="https://www.version-cli.app"
86+ org.opencontainers.image.source=${{ github.event.repository.html_url }}
87+ org.opencontainers.image.version=${{ steps.draft_release.outputs.tag_name }}
88+ org.opencontainers.image.revision=${{ steps.draft_release.outputs.tag_name }}
89+ org.opencontainers.image.vendor="version-cli"
90+ org.opencontainers.image.licenses=# TODO: add license
91+ org.opencontainers.image.ref.name=${{ steps.draft_release.outputs.tag_name }}
92+ org.opencontainers.image.title=${{ github.event.repository.name }}
93+ org.opencontainers.image.description=${{ github.event.repository.description }}
94+ org.opencontainers.image.base.digest=${{ steps.base_image.outputs.name }}
95+ org.opencontainers.image.base.name=${{ steps.base_image.outputs.digest }}
96+ build-args : |
97+ VERSION=${{ steps.draft_release.outputs.tag_name }}
98+ cache-from : type=gha
99+ cache-to : type=gha,mode=max
52100
53101 - name : Publish release
54- uses : release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # v6.0 .0
102+ uses : release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1 .0
55103 if : steps.draft_release.outputs.tag_name != ''
56104 with :
57105 version : ${{ steps.draft_release.outputs.tag_name }}
@@ -61,20 +109,20 @@ jobs:
61109 GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
62110
63111 - name : Checkout action code
64- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
112+ uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
65113 with :
66114 fetch-depth : 0
67115 ref : ${{ steps.draft_release.outputs.tag_name }}
68116
69117 - name : Setup Go environment
70- uses : actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
118+ uses : actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
71119 with :
72120 go-version-file : " go.mod"
73121
74122 - name : Run GoReleaser
75- uses : goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0 .0
123+ uses : goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4 .0
76124 with :
77- version : v2.0.1 # renovate: datasource=custom.goreleaser depName=goreleaser packageName=goreleaser/goreleaser
125+ version : v2.13.2 # renovate: datasource=github-tags depName=goreleaser packageName=goreleaser/goreleaser
78126 args : release --skip=publish --clean
79127 env :
80128 GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
@@ -89,28 +137,29 @@ jobs:
89137 FILES : dist/version_*.tar.gz dist/version_*.zip dist/version_*_checksums.txt
90138
91139 docs-deploy :
92- runs-on : ubuntu-22 .04
140+ runs-on : ubuntu-24 .04
93141 if : ${{ always() }}
94142 needs : release
95143 permissions :
96144 contents : write
97145 steps :
98- - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
146+ - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
99147 with :
100148 fetch-depth : 0
101149 - name : Configure Git Credentials
102150 run : |
103151 git config user.name version-cli[bot]
104152 git config user.email 41898282+github-actions[bot]@users.noreply.github.com
105153 - name : Install Poetry
106- # renovate: datasource=github-tags depName=poetry packageName=python-poetry/poetry
107- run : pipx install poetry==1.8.2
108- - uses : actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
154+ env :
155+ poetry_version : 2.2.1 # renovate: datasource=github-tags depName=poetry packageName=python-poetry/poetry
156+ run : pipx install poetry==$poetry_version
157+ - uses : actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
109158 with :
110159 python-version-file : pyproject.toml
111160 cache : " poetry"
112161 - run : echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
113- - uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
162+ - uses : actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
114163 with :
115164 key : mkdocs-material-${{ env.cache_id }}
116165 path : .cache
@@ -126,6 +175,7 @@ jobs:
126175 GOOGLE_ANALYTICS_KEY : ${{ secrets.GOOGLE_ANALYTICS_KEY }}
127176 MKDOCS_GIT_COMMITTERS_APIKEY : ${{ github.token }}
128177 EXCLUDE_SHIELDS_IO_PRIVACY : true
178+ VERSION_CLI_VERSION : ${{ needs.release.outputs.tag_name }}
129179 - name : Deploy release docs
130180 if : ${{ github.event_name == 'workflow_dispatch' && needs.release.result == 'success' }}
131181 run : |-
@@ -136,3 +186,4 @@ jobs:
136186 env :
137187 GOOGLE_ANALYTICS_KEY : ${{ secrets.GOOGLE_ANALYTICS_KEY }}
138188 MKDOCS_GIT_COMMITTERS_APIKEY : ${{ github.token }}
189+ VERSION_CLI_VERSION : ${{ needs.release.outputs.tag_name }}
0 commit comments