Repository navigation
116 lines (97 loc) · 3.73 KB
/
Copy pathrelease.yml
File metadata and controls
116 lines (97 loc) · 3.73 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
name: Release
on:
push:
branches:
- main
permissions:
contents: read
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release-stable:
runs-on: ubuntu-24.04
name: Release Stable
env:
NPM_CONFIG_PROVENANCE: "true"
permissions:
contents: write
id-token: write # Needed for npm trusted publishing
pull-requests: write
outputs:
published: ${{ steps.changesets.outputs.published }}
steps:
- name: Checkout Repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
- name: Setup NodeJS
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: "pnpm"
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@ae32849d5ba541f9ae29e40e22a623bc13562f51 # v2.1.2
with:
pr-title: "chore(release): new version"
commit-message: "chore(release): new version"
publish-script: pnpm release
version-script: pnpm changeset-version
push-with-git-cli: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get current package version
id: get_version
run: echo "current_package_version=$(node -p "require('./presentation-exchange/package.json').version")" >> $GITHUB_OUTPUT
- name: Create Github Release
if: "startsWith(github.event.head_commit.message, 'chore(release): new version')"
uses: softprops/action-gh-release@8a0cd651e5b2365bd640854a3fa5dfc70e4875f3 # v3.0.4
with:
tag_name: v${{ steps.get_version.outputs.current_package_version }}
release-unstable:
runs-on: ubuntu-24.04
name: Release Unstable
needs: release-stable
if: always() && github.event_name == 'push' && needs.release-stable.outputs.published == 'false'
env:
NPM_CONFIG_PROVENANCE: "true"
permissions:
contents: write
id-token: write # Needed for npm trusted publishing
steps:
- name: Checkout Repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
- name: Setup NodeJS
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: "pnpm"
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Create unstable release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# ensure there's always a patch release created
cat << 'EOF' > .changeset/snapshot-template-changeset.md
---
'presentation-exchange': patch
---
snapshot release
EOF
pnpm changeset version --snapshot alpha
pnpm style:fix
pnpm types:check
pnpm build
pnpm esm:check
pnpm changeset publish --tag alpha
CURRENT_PACKAGE_VERSION=$(node -p "require('./presentation-exchange/package.json').version")
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag v$CURRENT_PACKAGE_VERSION
git push origin v$CURRENT_PACKAGE_VERSION --no-verify