-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (66 loc) · 2.2 KB
/
Copy pathrelease.yml
File metadata and controls
80 lines (66 loc) · 2.2 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
name: Create Release
on:
workflow_dispatch:
inputs:
version:
description: "Version (SemVer)"
required: true
default: 0.0.0
jobs:
set-version:
name: Update version in documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.BOT_TOKEN }}
- name: Install required dependencies
run: npm install
- name: Update package version
run: npm version ${{ github.event.inputs.version }} --git-tag-version=false
- name: Update README
run: npm run generate-readme ${{ github.event.inputs.version }}
- name: Add corresponding commit
run: |
git config --global user.name 'OpenFoxes Maintenance Bot'
git config --global user.email 'openfoxes@bono-fox.de'
git init
git add .
git commit -m "🔖 Release ${{ github.event.inputs.version }}" -m "- Updated documentation"
git tag v${{ github.event.inputs.version }}
git push -u origin HEAD:main --tags
create-npm-release:
name: "Create NPM release"
runs-on: ubuntu-latest
needs: [set-version]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.BOT_TOKEN }}
- name: Fetch current state
run: git fetch && git checkout origin/main
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Prepare NPM credentials
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
echo email=${{ secrets.NPM_EMAIL }} >> .npmrc
echo always-auth=true >> .npmrc
- name: Publish to NPM
run: npm publish --access=public --verbose
create-github-release:
name: "Create GitHub release"
runs-on: ubuntu-latest
needs: [create-npm-release]
steps:
- uses: actions/checkout@v4
- uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.ACTION_TOKEN }}
name: Version ${{ github.event.inputs.version }}
tag_name: v${{ github.event.inputs.version }}