forked from dfinity/pic-js
-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (89 loc) · 3.28 KB
/
release.yml
File metadata and controls
107 lines (89 loc) · 3.28 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+b[0-9]+'
env:
SCCACHE_GHA_ENABLED: 'true'
RUSTC_WRAPPER: 'sccache'
jobs:
release:
name: release
runs-on: ubuntu-latest
outputs:
is_beta: ${{ steps.is_beta.outputs.is_beta_tag }}
environment:
name: npm
url: https://www.npmjs.com/package/@dfinity/pic
steps:
- name: Checkout Code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup Python
uses: dfinity/ci-tools/actions/setup-python@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main
- name: Setup Commitizen
uses: dfinity/ci-tools/actions/setup-commitizen@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main
- name: Setup PNPM
uses: dfinity/ci-tools/actions/setup-pnpm@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main
- name: Determine if Beta Release
id: is_beta
uses: dfinity/ci-tools/actions/is-beta-tag@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main
- name: Build NPM packages
run: pnpm build
- name: Generate release notes
uses: dfinity/ci-tools/actions/generate-release-notes@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
run: |
npm pack ./packages/pic/
release_cmd="npm publish --verbose --access public"
if [ "${{ steps.is_beta.outputs.is_beta_tag }}" = 'true' ]; then
release_cmd="$release_cmd --tag beta"
fi
release_cmd="$release_cmd ./packages/pic/"
$release_cmd
- name: Create Github release
uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1.20.0
with:
artifacts: 'dfinity-pic-${{ github.ref_name }}.tgz'
bodyFile: 'RELEASE_NOTES.md'
tag: '${{ github.ref_name }}'
commit: 'main'
prerelease: ${{ steps.is_beta.outputs.is_beta_tag == 'true' }}
makeLatest: ${{ steps.is_beta.outputs.is_beta_tag == 'false' }}
build_docs:
name: Build Docs
runs-on: ubuntu-latest
needs: release
if: ${{ needs.release.outputs.is_beta == 'false' }}
steps:
- name: Checkout Code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup PNPM
uses: dfinity/ci-tools/actions/setup-pnpm@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main
- name: Build Docs
run: pnpm -F docs build
- name: Fix permissions
run: |
chmod -c -R +rX "docs/build/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
path: docs/build/
deploy_docs:
name: Deploy Docs
runs-on: ubuntu-latest
needs: build_docs
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5