-
Notifications
You must be signed in to change notification settings - Fork 87
57 lines (57 loc) · 1.87 KB
/
pre-release.yml
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
name: prerelease
on:
push:
branches:
# releases/<tag>/<version>
# releases/alpha.1/5.0.0 - will result in 5.0.0-alpha.1
- releases/*/*
jobs:
prerelease:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: npm
registry-url: 'https://registry.npmjs.org'
- name: Install core dependencies
run: npm ci --no-audit
- name: Install Deno
uses: denoland/setup-deno@v1
with:
# Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/edge-bundler/blob/e55f825bd985d3c92e21d1b765d71e70d5628fba/node/bridge.ts#L17
deno-version: v1.37.0
- name: Extract tag and version
id: extract
run: |-
ref=${{ github.ref }}
branch=${ref:11}
tag_version=${branch:9}
tag=${tag_version%/*}
version=${tag_version##*/}
echo "tag=${tag}" >> $GITHUB_OUTPUT
echo "version=${version}" >> $GITHUB_OUTPUT
- name: Log versions
run: |-
echo tag=${{ steps.extract.outputs.tag }}
echo version=${{ steps.extract.outputs.version }}
- name: Setup git user
run: git config --global user.name github-actions
- name: Setup git email
run: git config --global user.email [email protected]
- name: Run npm version
run:
npm version ${{ steps.extract.outputs.version }}-${{ steps.extract.outputs.tag }}
--allow-same-version
- name: Push changes
run: git push --follow-tags
- name: build
run: npm run build
- name: Run npm publish
run: npm publish --tag=${{ steps.extract.outputs.tag }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}