Repository navigation
63 lines (53 loc) · 1.9 KB
/
Copy pathrelease.yml
File metadata and controls
63 lines (53 loc) · 1.9 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
name: "Release"
# The automatic release pipeline. Pushing a v* tag runs the full quality gate,
# packages the extension exactly once, publishes a GitHub Release, then ships that
# same asset to the Chrome, Edge, and Firefox stores.
on:
push:
tags: ["v*"]
permissions:
contents: read
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
ci:
uses: ./.github/workflows/ci.yml
release:
name: "GitHub Release"
needs: ci
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- name: Guard tag matches manifest and package.json versions
run: |
manifest_ver=$(grep -m1 '"version"' src/manifest.json \
| sed -E 's/.*"version"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/')
pkg_ver=$(grep -m1 '"version"' package.json \
| sed -E 's/.*"version"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/')
echo "tag=$GITHUB_REF_NAME manifest=$manifest_ver package.json=$pkg_ver"
if [ "$GITHUB_REF_NAME" != "v$manifest_ver" ] || [ "$manifest_ver" != "$pkg_ver" ]; then
echo "::error::Version mismatch — tag '$GITHUB_REF_NAME' must equal 'v$manifest_ver' (src/manifest.json) and package.json must match ($pkg_ver). Bump all three in lockstep before tagging."
exit 1
fi
- name: Download packaged extension
uses: actions/download-artifact@v8
with:
name: mortality-zip
path: artifacts
- name: Publish GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "$GITHUB_REF_NAME" artifacts/mortality-*.zip \
--title "$GITHUB_REF_NAME" --generate-notes
publish:
name: "Stores"
needs: release
uses: ./.github/workflows/publish.yml
with:
stores: "all"
tag: ${{ github.ref_name }}
secrets: inherit