@@ -13,13 +13,10 @@ permissions:
1313 contents : write
1414
1515jobs :
16- release :
16+ desktop :
1717 runs-on : windows-latest
1818 permissions :
1919 contents : write
20- outputs :
21- tag : ${{ steps.version.outputs.tag }}
22- version : ${{ steps.version.outputs.version }}
2320
2421 steps :
2522 - uses : actions/checkout@v4
4542 run : |
4643 REF="${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}"
4744 VERSION="${REF#v}"
48- # Strip pre-release suffix (e.g. 0.2.1-rc1 → 0.2.1) — WiX/MSI requires
49- # numeric-only pre-release identifiers, so any alpha suffix breaks the build.
5045 VERSION_MSI="${VERSION%%-*}"
5146 echo "version=$VERSION" >> "$GITHUB_OUTPUT"
5247 echo "version_msi=$VERSION_MSI" >> "$GITHUB_OUTPUT"
8075 prerelease : false
8176
8277 docker :
83- needs : release
8478 runs-on : ubuntu-latest
8579 permissions :
8680 contents : write
8983 steps :
9084 - uses : actions/checkout@v4
9185
86+ - name : Extract tag
87+ id : version
88+ run : |
89+ REF="${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}"
90+ echo "tag=${REF}" >> "$GITHUB_OUTPUT"
91+
9292 - name : Log in to GitHub Container Registry
9393 uses : docker/login-action@v3
9494 with :
@@ -104,27 +104,35 @@ jobs:
104104 push : true
105105 tags : |
106106 ghcr.io/unicef/adt-studio:latest
107- ghcr.io/unicef/adt-studio:${{ needs.release.outputs.tag }}
107+ ghcr.io/unicef/adt-studio:${{ steps.version.outputs.tag }}
108+
109+ - name : Ensure GitHub release exists
110+ env :
111+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
112+ run : |
113+ TAG="${{ steps.version.outputs.tag }}"
114+ gh release view "$TAG" --repo ${{ github.repository }} 2>/dev/null || \
115+ gh release create "$TAG" --repo ${{ github.repository }} --title "ADT Studio $TAG" --notes ""
108116
109117 - name : Generate standalone docker-compose.yml
110118 run : |
111- TAG="${{ needs.release .outputs.tag }}"
119+ TAG="${{ steps.version .outputs.tag }}"
112120 sed "s/__TAG__/${TAG}/g" docker/compose-release.yml.template > docker-compose.yml
113121
114122 - name : Upload docker-compose.yml to release
115123 env :
116124 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
117125 run : |
118- gh release upload ${{ needs.release .outputs.tag }} docker-compose.yml \
126+ gh release upload ${{ steps.version .outputs.tag }} docker-compose.yml \
119127 --repo ${{ github.repository }} \
120128 --clobber
121129
122130 - name : Generate release notes
123131 env :
124132 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
125- shell : bash
126133 run : |
134+ TAG="${{ steps.version.outputs.tag }}"
127135 NOTES=$(gh api repos/${{ github.repository }}/releases/generate-notes \
128- -f tag_name=${{ github.ref_name }} \
136+ -f tag_name="$TAG" \
129137 --jq '.body')
130- gh release edit ${{ needs.release.outputs.tag }} --notes "$NOTES"
138+ gh release edit "$TAG" --notes "$NOTES"
0 commit comments