-
Notifications
You must be signed in to change notification settings - Fork 189
54 lines (47 loc) · 1.44 KB
/
publish.yml
File metadata and controls
54 lines (47 loc) · 1.44 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
name: Publish
on:
release:
types:
- published
- edited
jobs:
build:
name: Build and tag a new version
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout the current code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: true
ref: ${{ github.event.release.tag_name }}
- name: Configure the runtime node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
cache: npm
cache-dependency-path: package-lock.json
node-version-file: .nvmrc
- name: Install project dependencies
run: npm ci
- name: Build a production release
run: npm run build
- name: Distribute the latest tagged release
id: tag
uses: teunmooij/github-versioned-release@3edf649c6e5e5e976d43f2584b15bdc8b4c8f0df # v1.2.1
with:
template: javascript-action
include: |
dist/**/*
cli/**/*
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Create a branch for tagged release
run: |
git fetch origin "$SHA"
git checkout -b "release/$TAG" "$SHA"
git push origin "release/$TAG"
env:
TAG: ${{ github.event.release.tag_name }}
SHA: ${{ steps.tag.outputs.sha }}