-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (92 loc) · 2.81 KB
/
release_publish.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Release and Publish
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
branches:
- 'development'
pull_request:
branches:
- development
workflow_dispatch:
inputs:
version_type:
description: 'Specify version bump type'
required: false
default: 'patch'
type: choice
options:
- patch
- minor
- major
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
- name: Remove Tag Prefix
run: npm config set tag-version-prefix ""
- name: Configure Git
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
- name: Install dependencies
run: npm ci
- name: Get Version
id: get_version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "VERSION=$VERSION" >> $GITHUB_ENV
#- name: Update Version
# id: update_version
# run: |
# npm version {{ github.event.inputs.version_type || 'patch' }} -m "Automated bump to %s"
# new_version=$(node -p "require('./package.json').version")
# echo "new_version=$new_version" >> $GITHUB_OUTPUT
#- name: Run Version Bump Script
# run: npm run bump-version
#- name: Commit Version Bump Changes
# run: |
# git add .
# git commit -m "Update manifest and versions to s{{ steps.update_version.outputs.new_version }}"
- name: Build Project
run: npm run build
- name: Commit Build Artifacts
run: |
git add .
git commit -m "Build artifacts for version ${{ env.VERSION }}"
- name: Set up authentication
run: |
git remote set-url origin https://x-access-token:${{ secrets.REPO_TOKEN }}@github.com/${{ github.repository }}.git
- name: Push Changes
run: |
git push origin development --follow-tags
#- name: Publish to npm
# env:
# NODE_AUTH_TOKEN: {{ secrets.NPM_TOKEN }}
# run: npm publish
- name: Create GitHub Release
uses: softprops/[email protected]
with:
tag_name: "${{ env.VERSION }}"
name: "${{ env.VERSION }}"
body: |
Automated release of version ${{ env.VERSION }}.
- name: Upload Plugin Files
uses: actions/[email protected]
with:
name: insta-toc-${{ env.VERSION }}
path: |
manifest.json
main.js
styles.css