-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub actions workflow to create a release when pushing a releas…
…e tag This PR sets up a workflow to publish a release when a tag with a `release-` prefix is pushed to the repository. The release will only be created as a draft to allow for manual modifications before actually publishing.
- Loading branch information
Frederik Rothenberger
committed
Jun 28, 2024
1 parent
0a98cf6
commit 0ebbfb0
Showing
1 changed file
with
73 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
on: | ||
push: | ||
tags: | ||
- 'release-*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/cache@v4 | ||
id: cache | ||
with: | ||
path: | | ||
~/.cargo | ||
target | ||
key: cargo-${{ hashFiles('rust-toolchain.toml', 'Cargo.lock') }} | ||
restore-keys: cargo- | ||
|
||
- name: Install ic-wasm | ||
run: cargo install ic-wasm --version 0.3.5 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
|
||
- name: 'Build Issuer' | ||
run: ./dummy-issuer/build.sh | ||
|
||
- name: 'Build Relying Party' | ||
run: ./dummy-relying-party/build.sh | ||
|
||
- name: Create Release | ||
uses: actions/github-script@v7 | ||
id: create-release | ||
with: | ||
script: | | ||
const response = await github.rest.repos.createRelease({ | ||
owner: "dfinity", | ||
repo: "verifiable-credentials-sdk", | ||
tag_name: "${{ github.ref_name }}", | ||
name: "${{ github.ref_name }}", | ||
body: "For release notes, please see the [changelog](https://github.com/dfinity/verifiable-credentials-sdk/blob/main/CHANGELOG.md#${{ github.ref_name }})", | ||
draft: true, | ||
prerelease: false, | ||
generate_release_notes: false, | ||
}).data; | ||
- name: Upload Issuer Wasm | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
await github.rest.repos.uploadReleaseAsset({ | ||
owner: "dfinity", | ||
repo: "verifiable-credentials-sdk", | ||
id: ${{ steps.create-release.outputs.result.id }}, | ||
name: "dummy_issuer.wasm.gz", | ||
data: require('fs').readFileSync('./dummy-issuer/dummy_issuer.wasm.gz'), | ||
})); | ||
- name: Upload Relying Party Wasm | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
await github.rest.repos.uploadReleaseAsset({ | ||
owner: "dfinity", | ||
repo: "verifiable-credentials-sdk", | ||
id: ${{ steps.create-release.outputs.result.id }}, | ||
name: "dummy_relying_party.wasm.gz", | ||
data: require('fs').readFileSync('./dummy-relying-party/dummy_relying_party.wasm.gz'), | ||
})); |