@@ -2,10 +2,6 @@ name: release
22
33on :
44 workflow_dispatch :
5- inputs :
6- preview :
7- description : ' Preview tag if not empty. Needs to be in format vX.Y.Z-preview.X'
8- type : string
95 pull_request :
106 types : [closed]
117 branches :
2723 - name : Get version
2824 id : release_info
2925 run : |
30- if [[ "${{ github.event.inputs.preview || 'false' }}" != "false" ]]; then
31- # check if valid
32- if [[ ! "${{ github.event.inputs.preview }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-preview\.[0-9]+$ ]]; then
33- echo "Invalid preview tag format. Needs to be in format vX.Y.Z-preview.X"
34- exit 1
35- fi
36- echo "tag_name=${{ github.event.inputs.preview }}" >> $GITHUB_OUTPUT
37- else
38- cargo install cargo-get
39- echo "tag_name=v$(cargo get workspace.package.version)" >> $GITHUB_OUTPUT
40- fi
26+ cargo install cargo-get
27+ echo "tag_name=v$(cargo get workspace.package.version)" >> $GITHUB_OUTPUT
4128
4229 release :
4330 name : ${{ matrix.job.target }} (${{ matrix.job.os }})
@@ -162,7 +149,6 @@ jobs:
162149 env :
163150 GITHUB_USER : ${{ github.repository_owner }}
164151 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
165- if : ${{ !contains(needs.prepare.outputs.tag_name, 'preview') }}
166152 steps :
167153 - uses : actions/checkout@v4
168154 - uses : actions/download-artifact@v4
@@ -204,17 +190,6 @@ jobs:
204190 password : ${{ secrets.GITHUB_TOKEN }}
205191
206192 - name : Build and push docker image
207- if : ${{ contains(needs.prepare.outputs.tag_name, 'preview') }}
208- uses : docker/build-push-action@v3
209- with :
210- push : true
211- tags : ghcr.io/${{ github.repository }}:${{ needs.prepare.outputs.tag_name }}
212- platforms : linux/amd64,linux/arm64
213- build-contexts : |
214- artifacts=artifacts
215-
216- - name : Build and push docker image
217- if : ${{ !contains(needs.prepare.outputs.tag_name, 'preview') }}
218193 uses : docker/build-push-action@v3
219194 with :
220195 push : true
0 commit comments