-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (72 loc) · 2.48 KB
/
Copy pathrelease-beta.yml
File metadata and controls
85 lines (72 loc) · 2.48 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
name: Beta Release (manual retry)
# The automatic beta release runs inside ci.yml (as a job gated on build+test, triggered by the
# actual `push` to develop) — see that file for why. This workflow is only the manual fallback
# for a release that failed mid-way: a `[skip ci]` release commit never triggers push, and
# re-running a failed CI run pins the old SHA, so semantic-release refuses with "local branch is
# behind the remote one". Dispatch this against develop to retry from its current tip instead.
on:
workflow_dispatch:
concurrency:
group: release-beta
cancel-in-progress: false
permissions:
actions: read
contents: write
issues: write
pull-requests: write
jobs:
release-beta:
if: github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Verify successful CI for manual release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ci_run_id="$(gh run list \
--workflow ci.yml \
--branch develop \
--commit "$GITHUB_SHA" \
--event push \
--status success \
--limit 1 \
--json databaseId \
--jq '.[0].databaseId // empty')"
if [[ -z "$ci_run_id" ]]; then
echo "No successful CI run found for develop commit $GITHUB_SHA"
exit 1
fi
echo "Verified successful CI run: $ci_run_id"
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'npm'
- name: Install dependencies
run: npm ci --no-audit
- name: Build
run: npm run build
- name: Verify build output
run: |
if [[ ! -d "dist" ]]; then
echo "Build failed: dist directory not found"
exit 1
fi
echo "Build verification passed"
- name: Configure Git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git
git fetch --all --tags
- name: Release Beta
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run release