-
Notifications
You must be signed in to change notification settings - Fork 89
45 lines (42 loc) · 1.85 KB
/
wasm-automatic-release-and-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Wasm Automatic Release and Publish
# Automatically publishes the latest Wasm bindings version to npm when a release PR is merged.
# Does NOT create a GitHub release.
on:
pull_request:
branches:
- main
- support/wasm-v*
types: [closed]
jobs:
call-create-release-workflow:
if: github.event.pull_request.merged == true
# owner/repository of workflow has to be static, see https://github.community/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-release.yml@main
with:
changelog-config-path: ./bindings/wasm/.github_changelog_generator
pre-release-tag-regex: ^wasm-v[0-9]+\.[0-9]+\.[0-9]+-(?<pre_release>\w+)\.\d+$
main-release-tag-regex: ^wasm-v[0-9]+\.[0-9]+\.[0-9]+$
create-github-release: false
secrets:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
build-wasm:
needs: call-create-release-workflow
if: ${{ needs.call-create-release-workflow.outputs.is-release }}
# owner/repository of workflow has to be static, see https://github.community/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-build-wasm.yml@main
with:
output-artifact-name: identity-wasm-bindings-build
release-wasm:
if: ${{ needs.call-create-release-workflow.outputs.is-release }}
runs-on: ubuntu-latest
needs: [call-create-release-workflow, build-wasm]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Release to npm
uses: './.github/actions/publish/publish-wasm'
with:
input-artifact-name: identity-wasm-bindings-build
npm-token: ${{ secrets.NPM_TOKEN }}
tag: ${{ needs.call-create-release-workflow.outputs.is-pre-release && needs.call-create-release-workflow.outputs.pre-release-identifier }}