This repository has been archived by the owner on Sep 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
47 lines (47 loc) · 1.69 KB
/
release.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
46
47
name: Release
on:
release:
types:
- created
jobs:
publish:
name: Build & Publish to NPM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: denoland/setup-deno@61fe2df320078202e33d7d5ad347e7dcfa0e8f31 # v1.1.0
with:
deno-version: v1.33.3
- name: Retrieve Version
if: startsWith(github.ref, 'refs/tags/')
id: get_tag_version
run: echo "tag_version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- uses: actions/setup-node@v3
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
- name: Build NPM Package
run: deno task dnt --version ${{steps.get_tag_version.outputs.tag_version}} --server ${{steps.get_tag_version.outputs.tag_version}}
- uses: actions/upload-artifact@v3
with:
name: package
path: "./target/npm/capi-*.tgz"
- uses: octokit/request-action@v2.x
if: startsWith(github.ref, 'refs/tags/')
with:
route: POST /repos/paritytech/npm_publish_automation/actions/workflows/publish.yml/dispatches
ref: main
inputs: '${{ format(''{{ "repo": "{0}", "run_id": "{1}" }}'', github.repository, github.run_id) }}'
env:
GITHUB_TOKEN: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }}
- name: Report failure
if: ${{ failure() }}
run: >
gh issue create
-a tjjfvi
-a harrysolovay
-l failure
-t 'npm publish failure: ${{steps.get_tag_version.outputs.tag_version}}'
-b "https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
env:
GH_TOKEN: ${{ github.token }}