-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (63 loc) · 2.14 KB
/
release.yml
File metadata and controls
81 lines (63 loc) · 2.14 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
name: Release
on:
workflow_dispatch:
concurrency:
group: release
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
# Validate code
- name: Install dependencies
run: npm install
- name: CI script (type checks, linting, build, exports validation)
run: npm run ci
- name: Test script with coverage reporting
run: npm run test-coverage
- name: Environment reset
run: npm run reset
# Create tag and release
- name: Configure git identity
uses: ./.github/git-actions/configure-identity
- name: Fetch repository tags
run: git fetch --tags
- name: Get package.json version
uses: ./.github/package-actions/get-version
id: package-version
- name: Check if release exists
uses: ./.github/github-actions/release-exists
id: release-exists
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: 'v${{ steps.package-version.outputs.version }}'
- name: Check if tag exists
uses: ./.github/git-actions/tag-exists
id: tag-exists
with:
tag: 'v${{ steps.package-version.outputs.version }}'
- name: Exit if the release or tag already exists
if: steps.release-exists.outputs.exists == 'true' || steps.tag-exists.outputs.exists == 'true'
run: |
echo "Release already exists: ${{ steps.release-exists.outputs.exists }}"
echo "Tag already exists: ${{ steps.tag-exists.outputs.exists }}"
exit 1
- name: Create tag
uses: ./.github/git-actions/create-tag
with:
tag: 'v${{ steps.package-version.outputs.version }}'
- name: Create release
uses: ./.github/github-actions/create-release
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: 'v${{ steps.package-version.outputs.version }}'