Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: upload the snap & snap_beta binaries to the GitHub release #255

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 55 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@ jobs:
- conventions

runs-on: ubuntu-22.04
outputs:
upload_url: ${{ steps.prepare.outputs.upload_url }}
steps:
- uses: actions/checkout@v1
- name: Install snap tools
Expand All @@ -515,6 +517,14 @@ jobs:
# retry 3 times because of flakey nuget; TODO: remove retry when we migrate to .NET6 (removing LEGACY_FRAMEWORK support)
./scripts/snap_build.sh || ./scripts/snap_build.sh || ./scripts/snap_build.sh || ./scripts/snap_build.sh

- name: Find the snap file's path and name
id: find_snap_file
run: |
FILEPATH=$(ls *.snap)
FILENAME=$(basename $FILEPATH)
echo "file_path=$FILEPATH" >> $GITHUB_OUTPUT
echo "file_name=$FILENAME" >> $GITHUB_OUTPUT

- name: Install snap
# dangerous because it's a local snap (not one from the SnapStore)
run: sudo snap install --dangerous *.snap
Expand All @@ -535,10 +545,34 @@ jobs:
sudo apt update
./scripts/snap_release.sh

- name: Prepare release
id: prepare
if: startsWith(github.ref, 'refs/tags/')
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload snap package As Release Asset
id: upload_snap_asset
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.prepare.outputs.upload_url }}
asset_path: ${{ steps.find_snap_file.outputs.file_path }}
asset_name: ${{ steps.find_snap_file.outputs.file_name }}
asset_content_type: application/octet-stream

snap_pkg_beta:

needs:
- conventions
- snap_pkg

runs-on: ubuntu-22.04
steps:
Expand All @@ -565,6 +599,14 @@ jobs:
# retry 3 times because of flakey nuget; TODO: remove retry when we migrate to .NET6 (removing LEGACY_FRAMEWORK support)
./scripts/snap_build.sh --native-segwit || ./scripts/snap_build.sh --native-segwit || ./scripts/snap_build.sh --native-segwit || ./scripts/snap_build.sh --native-segwit

- name: Find the snap file's path and name
id: find_snap_beta_file
run: |
FILEPATH=$(ls *.snap)
FILENAME=$(basename $FILEPATH)
echo "file_path=$FILEPATH" >> $GITHUB_OUTPUT
echo "file_name=$FILENAME" >> $GITHUB_OUTPUT

- name: Install snap
# dangerous because it's a local snap (not one from the SnapStore)
run: sudo snap install --dangerous *.snap
Expand All @@ -584,3 +626,15 @@ jobs:
run: |
sudo apt update
./scripts/snap_release.sh beta

- name: Upload snap beta package As Release Asset
id: upload_snap_beta_asset
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.snap_pkg.outputs.upload_url }}
asset_path: ${{ steps.find_snap_beta_file.outputs.file_path }}
asset_name: ${{ steps.find_snap_beta_file.outputs.file_name }}
asset_content_type: application/octet-stream
Loading