forked from spinframework/spin
-
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.
Merge pull request spinframework#294 from bacongobbler/bump-upload-ar…
…tifact fix release upload process
- Loading branch information
Showing
1 changed file
with
68 additions
and
4 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 |
---|---|---|
|
@@ -99,23 +99,31 @@ jobs: | |
args: "--all-features --release ${{ matrix.config.extraArgs }}" | ||
|
||
- name: package release assets | ||
shell: bash | ||
if: runner.os != 'Windows' | ||
run: | | ||
mkdir _dist | ||
cp readme.md LICENSE ${{ matrix.config.targetDir }}/spin${{ matrix.config.extension }} _dist/ | ||
cd _dist | ||
tar czf spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz readme.md LICENSE spin${{ matrix.config.extension }} | ||
zip -r spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.zip readme.md LICENSE spin${{ matrix.config.extension }} | ||
shasum -a 256 *.tar.gz *.zip > checksums-${{ env.RELEASE_VERSION }}.txt | ||
- name: package release assets | ||
if: runner.os == 'Windows' | ||
shell: bash | ||
run: | | ||
mkdir _dist | ||
cp readme.md LICENSE ${{ matrix.config.targetDir }}/spin${{ matrix.config.extension }} _dist/ | ||
cd _dist | ||
tar czf spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz readme.md LICENSE spin${{ matrix.config.extension }} | ||
7z a -tzip spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.zip readme.md LICENSE spin${{ matrix.config.extension }} | ||
- name: upload binary as GitHub artifact | ||
uses: actions/upload-artifact@v1 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: spin | ||
path: | | ||
_dist/spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz | ||
_dist/spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.zip | ||
_dist/checksums-${{ env.RELEASE_VERSION }}.txt | ||
# TODO: actually update/override the canary release each time | ||
# See https://github.com/fermyon/spin/issues/128 | ||
|
@@ -132,3 +140,59 @@ jobs: | |
body: | | ||
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 Spin, some of which may not be fully implemented. | ||
- name: upload binary to canary GitHub release | ||
uses: svenstaro/[email protected] | ||
if: github.ref == 'refs/heads/main' | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: _dist/spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.zip | ||
asset_name: spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.zip | ||
tag: canary | ||
overwrite: true | ||
prerelease: true | ||
body: | | ||
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 Spin, some of which may not be fully implemented. | ||
checksums: | ||
name: generate release checksums | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: set the release version (tag) | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
shell: bash | ||
run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | ||
|
||
- name: set the release version (main) | ||
if: github.ref == 'refs/heads/main' | ||
shell: bash | ||
run: echo "RELEASE_VERSION=canary" >> $GITHUB_ENV | ||
|
||
- name: download release assets | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: spin | ||
|
||
- name: generate checksums | ||
run: sha256sum * > checksums-${{ env.RELEASE_VERSION }}.txt | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: spin | ||
path: checksums-${{ env.RELEASE_VERSION }}.txt | ||
|
||
- name: upload checksums to canary GitHub release | ||
uses: svenstaro/[email protected] | ||
if: github.ref == 'refs/heads/main' | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: checksums-${{ env.RELEASE_VERSION }}.txt | ||
asset_name: checksums-${{ env.RELEASE_VERSION }}.txt | ||
tag: canary | ||
overwrite: true | ||
prerelease: true | ||
body: | | ||
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 Spin, some of which may not be fully implemented. |