-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 1.59 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: release
on:
workflow_run:
workflows: [ci]
types:
- completed
branches: [main]
permissions:
contents: write
pull-requests: write
jobs:
release-please:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Package name
id: name
run: echo "::set-output name=name::$(jq -r .name package.json)"
- name: Create release PR
uses: googleapis/release-please-action@v4
id: release
with:
release-type: node
config-file: .github/release-please-config.json
target-branch: main
upload-artifact:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup NodeJS version (from .nvmrc)
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install dependencies
run: npm ci
- name: Save archive
run: echo "archive=$(npm pack 2>/dev/null | tail -1)" >> $GITHUB_ENV
- name: Upload ${{ env.archive }} to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ needs.release-please.outputs.tag_name }} ${{ env.archive }}