-
Notifications
You must be signed in to change notification settings - Fork 0
167 lines (161 loc) · 4.88 KB
/
prerelease.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
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
155
156
157
158
159
160
161
162
163
164
165
166
167
name: Prerelease
########################
### Release Pipeline ###
########################
# This pipeline is triggered when a new tag is pushed to the repository.
# This should usually be triggered by creating a GitHub Release in the repository.
# We use a commitless release workflow, meaning no version numbers are written into
# the repository. You can, therefore, tag any commit you want to make it a release.
#
# The pipeline generally consists of two stages:
# 1. Test things to ensure we don't publish any broken code.
# 2. Publish the code to the respective package registry or the like.
#
# These stages are applied to all libraries in this monorepo.
# Only on release tags – prereleases get handled separately.
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+-**"
# Defines which tool versions should be used in all workflow jobs
env:
node: '22'
pnpm: '9'
# Add the necessary permissions:
# - contents: write
# - id-token: write for the publish-backend-deno job (JSR publishing)
permissions:
contents: write
id-token: write
jobs:
####################
### backend-deno ###
####################
test-backend-deno:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend-deno
steps:
- name: Checkout 📥
uses: actions/[email protected]
- name: Setup Virtual Environment 🛠️
run: |-
../backend-features/tools/setup-venv.sh
- name: Run Tests 🧪
run: |-
. ../backend-features/.venv/bin/activate
../backend-features/run-tests.py -v .
publish-backend-deno:
runs-on: ubuntu-latest
needs: test-backend-deno
defaults:
run:
working-directory: ./backend-deno
steps:
- name: Checkout 📥
uses: actions/[email protected]
- name: Setup Deno
uses: denolib/setup-deno@v2
with:
deno-version: v2.x
- name: Update version in `deno.json`
run: |
tag=${GITHUB_REF#refs/tags/}
version=${tag#v}
jq --arg version "$version" '.version = $version' deno.json > tmp.$$.json
mv tmp.$$.json deno.json
- name: Publish to JSR
run: deno publish --allow-dirty
##################
### backend-go ###
##################
test-backend-go:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend-go
steps:
- name: Checkout 📥
uses: actions/[email protected]
- name: Setup Virtual Environment 🛠️
run: |-
../backend-features/tools/setup-venv.sh
- name: Run Tests 🧪
run: |-
. ../backend-features/.venv/bin/activate
../backend-features/run-tests.py -v .
publish-backend-go:
runs-on: ubuntu-latest
needs: test-backend-go
defaults:
run:
working-directory: ./backend-go
steps:
- name: Checkout 📥
uses: actions/[email protected]
- name: Create Go Version Tag
run: |
tag=${GITHUB_REF#refs/tags/}
git tag -a "backend-go/$tag" -m "Go Release $tag"
git push origin "backend-go/$tag"
######################
### frontend-react ###
######################
test-frontend-react:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend-react
steps:
- name: Checkout 📥
uses: actions/[email protected]
- name: Setup PNPM 💿
uses: pnpm/action-setup@v4
with:
version: ${{ env.pnpm }}
- name: Setup Node 💿
uses: actions/[email protected]
with:
node-version: ${{ env.node }}
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Install dependencies 📚
run: pnpm install
- name: Run unit tests 🛃
run: |
pnpm run ci:test
publish-frontend-react:
runs-on: ubuntu-latest
needs: test-frontend-react
defaults:
run:
working-directory: ./frontend-react
steps:
- name: Checkout 📥
uses: actions/[email protected]
- name: Setup PNPM 💿
uses: pnpm/action-setup@v4
with:
version: ${{ env.pnpm }}
- name: Setup Node 💿
uses: actions/[email protected]
with:
node-version: ${{ env.node }}
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Install dependencies 📚
run: pnpm install
- name: Build 🏗️
run: pnpm run build
- name: Update version in `package.json`
run: |
tag=${GITHUB_REF#refs/tags/}
version=${tag#v}
jq --arg version "$version" '.version = $version' package.json > tmp.$$.json
mv tmp.$$.json package.json
- name: Publish to NPM 📦
run: pnpm publish --access public --no-git-checks --tag next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true