forked from fermyon/cloud-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(release.yml): create GH release after all artifacts are uploaded
Signed-off-by: Vaughn Dice <[email protected]>
- Loading branch information
Showing
1 changed file
with
24 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,17 +134,9 @@ jobs: | |
- name: Upload build artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: cloud-${{ env.RUNNER_OS }}-${{ matrix.config.arch }} | ||
name: cloud | ||
path: _dist/cloud-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz | ||
|
||
- name: upload binary to Github release | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: _dist/cloud-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz | ||
tag: ${{ github.ref }} | ||
|
||
checksums_and_manifests: | ||
name: generate checksums and manifest | ||
runs-on: ubuntu-latest | ||
|
@@ -193,57 +185,39 @@ jobs: | |
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cloud-plugin-manifest | ||
name: cloud | ||
path: cloud.json | ||
|
||
- name: upload plugin manifest to release | ||
uses: svenstaro/upload-release-action@v2 | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: cloud.json | ||
tag: ${{ github.ref }} | ||
|
||
reset_canary_release: | ||
name: Delete and create Canary Release | ||
create-gh-release: | ||
name: create GitHub release | ||
runs-on: ubuntu-latest | ||
needs: checksums_and_manifests | ||
if: github.ref == 'refs/heads/main' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: download release assets | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: cloud-* | ||
merge-multiple: true | ||
name: cloud | ||
path: _dist | ||
|
||
- name: 'Check if canary tag exists' | ||
id: canaryExists | ||
shell: bash | ||
- name: create GitHub release (canary) | ||
if: github.ref == 'refs/heads/main' | ||
run: | | ||
git fetch --prune --unshallow --tags | ||
git show-ref --tags --verify --quiet -- "refs/tags/canary" && \ | ||
echo "canaryExists=0" >> "$GITHUB_OUTPUT" || \ | ||
echo "canaryExists=1" >> "$GITHUB_OUTPUT" | ||
- name: Delete canary tag | ||
if: steps.canaryExists.outputs.canaryExists == 0 | ||
uses: dev-drprasad/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: canary | ||
delete_release: true | ||
|
||
- name: Recreate canary tag and release | ||
uses: ncipollo/[email protected] | ||
with: | ||
tag: canary | ||
allowUpdates: true | ||
prerelease: true | ||
artifacts: "cloud*.tar.gz,cloud.json,checksums-canary.txt" | ||
commit: ${{ github.sha }} | ||
body: | | ||
gh release delete canary --cleanup-tag | ||
gh release create canary _dist/* \ | ||
--title canary \ | ||
--prerelease \ | ||
--notes-file - <<- EOF | ||
This is a "canary" release of the most recent commits on our main branch. Canary is **not stable**. | ||
It is only intended for developers wishing to try out the latest features in cloud plugin, some of which may not be fully implemented. | ||
It is only intended for developers wishing to try out the latest features in Spin, some of which may not be fully implemented. | ||
EOF | ||
- name: create GitHub release | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
run: | | ||
gh release create ${{ github.ref_name }} _dist/* \ | ||
--title ${{ github.ref_name }} \ | ||
--generate-notes |