Skip to content

chore: update dependencies (#138) #19

chore: update dependencies (#138)

chore: update dependencies (#138) #19

Workflow file for this run

# CI that:
#
# * checks for a Git Tag that looks like a release
# * creates a Github Release™ and fills in its text
# * builds artifacts with cargo-dist (executable-zips, installers)
# * uploads those artifacts to the Github Release™
#
# Note that the Github Release™ will be created before the artifacts,
# so there will be a few minutes where the release has no artifacts
# and then they will slowly trickle in, possibly failing. To make
# this more pleasant we mark the release as a "draft" until all
# artifacts have been successfully uploaded. This allows you to
# choose what to do with partial successes and avoids spamming
# anyone with notifications before the release is actually ready.
name: Release binaries
permissions:
contents: write
# This task will run whenever you push a git tag that looks like a version
# like "v1", "v1.2.0", "v0.1.0-prerelease01", "my-app-v1.0.0", etc.
# The version will be roughly parsed as ({PACKAGE_NAME}-)?v{VERSION}, where
# PACKAGE_NAME must be the name of a Cargo package in your workspace, and VERSION
# must be a Cargo-style SemVer Version.
#
# If PACKAGE_NAME is specified, then we will create a Github Release™ for that
# package (erroring out if it doesn't have the given version or isn't cargo-dist-able).
#
# If PACKAGE_NAME isn't specified, then we will create a Github Release™ for all
# (cargo-dist-able) packages in the workspace with that version (this is mode is
# intended for workspaces with only one dist-able package, or with all dist-able
# packages versioned/released in lockstep).
#
# If you push multiple tags at once, separate instances of this workflow will
# spin up, creating an independent Github Release™ for each one.
#
# If there's a prerelease-style suffix to the version then the Github Release™
# will be marked as a prerelease.
on:
workflow_call:
inputs:
release_tag:
required: true
type: string
push:
tags:
- '*-?v[0-9]+*'
jobs:
# Create the Github Release™ so the packages have something to be uploaded to
create-release:
runs-on: ubuntu-latest
outputs:
release-tag: ${{ steps.determine-release-tag.outputs.TAG }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Determine correct tag
id: determine-release-tag
run: |
echo 'INFO: Release tag received from input: ${{ inputs.release_tag }}'
echo 'INFO: GitHub context ref_name: ${{ github.ref_name }}'
if [[ "${{ github.workflow }}" == "Release with GitHub Action" ]]
then
echo "INFO: This run has been triggered from other workflow"
TAG=${{ inputs.release_tag }}
else
echo "INFO: This run has been triggered from pushing the tag"
TAG=${{ github.ref_name }}
fi
echo "INFO: The release tag is: $TAG"
echo "TAG=$TAG" >> "$GITHUB_ENV"
echo "TAG=$TAG" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v3
with:
ref: ${{ env.TAG }}
- name: Install Rust
run: rustup show
- id: create-release
run: gh release create ${{ env.TAG }} --draft --prerelease="true" --title="${{ env.TAG }}" --notes="TBD"
- name: Install dfx
uses: dfinity/setup-dfx@main
- name: Build WASM
run: |
dfx build --check
echo "Cycles ledger:"
ls .dfx/local/canisters/cycles-ledger
echo "Depositor:"
ls .dfx/local/canisters/depositor
echo "Fake CMC:"
ls .dfx/local/canisters/fake-cmc
(cd .dfx/local/canisters/cycles-ledger && shasum -a 256 cycles-ledger.wasm.gz > cycles-ledger.wasm.gz.sha256)
(cd .dfx/local/canisters/depositor && shasum -a 256 depositor.wasm.gz > depositor.wasm.gz.sha256)
(cd .dfx/local/canisters/fake-cmc && shasum -a 256 fake-cmc.wasm.gz > fake-cmc.wasm.gz.sha256)
gh release upload ${{ env.TAG }} .dfx/local/canisters/depositor/depositor.wasm.gz
gh release upload ${{ env.TAG }} .dfx/local/canisters/depositor/depositor.wasm.gz.sha256
gh release upload ${{ env.TAG }} depositor/depositor.did
gh release upload ${{ env.TAG }} .dfx/local/canisters/cycles-ledger/cycles-ledger.wasm.gz
gh release upload ${{ env.TAG }} .dfx/local/canisters/cycles-ledger/cycles-ledger.wasm.gz.sha256
gh release upload ${{ env.TAG }} cycles-ledger/cycles-ledger.did
gh release upload ${{ env.TAG }} .dfx/local/canisters/fake-cmc/fake-cmc.wasm.gz
gh release upload ${{ env.TAG }} .dfx/local/canisters/fake-cmc/fake-cmc.wasm.gz.sha256
gh release upload ${{ env.TAG }} fake-cmc/fake-cmc.did
echo "uploaded!"
- name: mark release as non-draft
run: |
gh release edit ${{ env.TAG }} --draft=false