forked from tenthirtyam/setup-task
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (60 loc) · 1.79 KB
/
release.yml
File metadata and controls
66 lines (60 loc) · 1.79 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
---
name: Release
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+-* # Pre-release tags like v1.0.0-beta
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: 24
cache: npm
- name: Install Dependencies
run: npm ci
- name: Build and Bundle
run: |
npm run build
- name: Run unit tests
run: npm test
- name: Run ESLint
run: npm run lint
release:
name: Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
fetch-depth: 0
- name: Get Version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RELEASE_NOTES="## Installation
\`\`\`yaml
- uses: tenthirtyam/setup-task@v${{ steps.get_version.outputs.VERSION }}
\`\`\`
Refer to the [\`README.md\`](https://github.com/tenthirtyam/setup-task/blob/main/README.md) for detailed usage information."
gh release create ${{ github.ref_name }} \
--title "v${{ steps.get_version.outputs.VERSION }}" \
--notes "$RELEASE_NOTES" \
${{ contains(github.ref, '-') && '--prerelease' || '' }}