-
Notifications
You must be signed in to change notification settings - Fork 14
154 lines (129 loc) · 3.64 KB
/
release.yml
File metadata and controls
154 lines (129 loc) · 3.64 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: Publish
on:
push:
branches:
- main
- release
- decoupling
workflow_dispatch:
concurrency: release
permissions:
contents: write
issues: read
id-token: write
jobs:
ci:
name: Continuous Integration
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run CI
uses: ./.github/actions/ci
with:
node-version: 22.x
commit-lint-from: ${{ github.event.before }}
commit-lint-to: ${{ github.sha }}
check_docs:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Install dependencies
run: npm ci
- name: Install docs dependencies
run: npm ci --prefix docs
- name: Verify documentation builds
run: npm run docs:build
build:
name: Build
uses: makerxstudio/shared-config/.github/workflows/node-build-zip.yml@main
needs:
- ci
- check_docs
with:
node-version: 22.x
build-path: dist
artifact-name: package
release:
name: Release
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Generate bot token
uses: actions/create-github-app-token@v1
id: app_token
with:
app-id: ${{ secrets.BOT_ID }}
private-key: ${{ secrets.BOT_SK }}
- uses: actions/checkout@v4
with:
# Fetch entire repository history so we can determine version number from it
fetch-depth: 0
token: ${{ steps.app_token.outputs.token }}
- name: Set Git user as GitHub actions
run: git config --global user.email "179917785+engineering-ci[bot]@users.noreply.github.com" && git config --global user.name "engineering-ci[bot]"
# semantic-release v25+ needs node 22.14+
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
registry-url: 'https://registry.npmjs.org'
- name: Download built package
uses: actions/download-artifact@v4
with:
name: package
path: artifacts
- name: Unzip package
shell: bash
run: |
mkdir -p dist
unzip -q "artifacts/package.zip" -d dist
- name: Install dependencies to get semantic release components and plugins
run: npm ci --ignore-scripts
- name: 'Semantic release'
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ steps.app_token.outputs.token }}
publish_docs:
name: Publish Documentation
runs-on: ubuntu-latest
needs:
- ci
- check_docs
if: github.ref == 'refs/heads/decoupling'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install docs dependencies
run: npm ci --prefix docs
- name: Build documentation
run: npm run docs:build
- name: Publish docs to GitHub Pages
id: deployment
uses: algorandfoundation/algokit-shared-config/.github/actions/publish-docs@main
with:
artifact_path: docs/dist