Repository navigation
124 lines (102 loc) · 3.63 KB
/
Copy pathrelease.yml
File metadata and controls
124 lines (102 loc) · 3.63 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
name: Release
on:
push:
branches: [main]
workflow_dispatch:
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
stable-release:
name: Release
runs-on: ubuntu-latest
if: github.event_name == 'push'
permissions:
contents: write
id-token: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # tag=v4.1.0
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # tag=v4.4.0
with:
node-version: '24.22.1'
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build packages
run: pnpm build
- name: Check release files
run: pnpm lint:ci
- name: Test packages
run: pnpm test
- name: Create release PR or publish packages
id: changesets
uses: changesets/action@ae32849d5ba541f9ae29e40e22a623bc13562f51 # tag=v2.1.2
with:
version-script: pnpm version-packages
publish-script: pnpm release
commit-message: 'chore: changeset version'
pr-title: 'chore: changeset version'
create-github-releases: false
push-git-tags: true
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
# @changesets/changelog-github reads the token from the environment.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create combined GitHub release
if: steps.changesets.outputs.published == 'true'
run: |
version=$(node -p "require('./packages/repack/package.json').version")
tag="@callstack/repack@${version}"
if gh release view "$tag" >/dev/null 2>&1; then
exit 0
fi
node .github/scripts/release-notes.mjs > "$RUNNER_TEMP/release-notes.md"
args=()
if [[ "$version" == *-* ]]; then
args+=(--prerelease)
fi
gh release create "$tag" --verify-tag --title "$version" \
--notes-file "$RUNNER_TEMP/release-notes.md" "${args[@]}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
canary-release:
name: Canary Release
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
permissions:
contents: read
id-token: write
pull-requests: read
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # tag=v4.1.0
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # tag=v4.4.0
with:
node-version: '24.22.1'
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Version packages for canary
run: pnpm version-packages:canary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build canary packages
run: pnpm build
- name: Check generated canary release files
run: pnpm lint:ci
- name: Test canary packages
run: pnpm test
- name: Publish canary packages
run: pnpm release:canary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}