-
Notifications
You must be signed in to change notification settings - Fork 13
58 lines (53 loc) · 1.75 KB
/
release-beta.yml
File metadata and controls
58 lines (53 loc) · 1.75 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
name: Manually Release a Beta Tag to NPM and GitHub
permissions:
contents: write # Needed by changesets/action to create releases and update tags.
on:
push:
branches:
- beta
# The beta release workflow requires an NPM_TOKEN for authentication.
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
concurrency: commits-to-beta
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout all commits
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Overwrite .npmrc with NPM token
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
- name: Setup
uses: ./.github/actions/setup-all
with:
bun_version: 1.2.18
go_version: 1.24.3
- name: Check for prerelease mode
id: check_pre
run: |
if [ -f .changeset/pre.json ]; then
echo "run=true"
echo "run=true" >> $GITHUB_OUTPUT
else
echo "run=false"
echo "run=false" >> $GITHUB_OUTPUT
fi
- name: Build for publishing
if: steps.check_pre.outputs.run == 'true'
shell: bash
run: nx run-many --target=build --configuration=production --all --parallel=5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Replace src code with dists for publishing
if: steps.check_pre.outputs.run == 'true'
run: ./scripts/replace-src-with-dists-for-publishing.sh
- name: Publish beta prerelease to NPM and GitHub
if: steps.check_pre.outputs.run == 'true'
uses: changesets/action@v1
with:
publish: bunx changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}