-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
590 additions
and
1,306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,9 @@ name: Release and Publish | |
on: | ||
push: | ||
tags: | ||
- 'v*' # Triggers the workflow when a new version tag (e.g., v1.0.0) is pushed. | ||
- 'v*' | ||
branches: | ||
- 'master' | ||
|
||
workflow_dispatch: | ||
inputs: | ||
version_type: | ||
|
@@ -19,22 +18,40 @@ on: | |
- minor | ||
- major | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
uses: actions/setup-node@v4.1.0 | ||
with: | ||
node-version: '22' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "GitHub Actions" | ||
git config user.email "[email protected]" | ||
- name: Install dependencies | ||
run: npm install | ||
run: npm ci | ||
|
||
- 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" | ||
- name: Update Version | ||
id: update_version | ||
|
@@ -46,21 +63,34 @@ jobs: | |
- name: Build Project | ||
run: npm run build | ||
|
||
- name: Commit Build Artifacts | ||
run: | | ||
git add . | ||
git commit -m "Build artifacts for version ${{ steps.update_version.outputs.new_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 HEAD --follow-tags | ||
- name: Publish to npm | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: npm publish | ||
|
||
- name: Create GitHub Release | ||
uses: softprops/action-gh-release@v1 | ||
uses: softprops/action-gh-release@v2.1.0 | ||
with: | ||
tag_name: "v${{ steps.update_version.outputs.new_version }}" | ||
name: "Release v${{ steps.update_version.outputs.new_version }}" | ||
body: | | ||
Automated release of version v${{ steps.update_version.outputs.new_version }}. | ||
- name: Upload Plugin Files | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4.4.3 | ||
with: | ||
name: insta-toc-${{ steps.update_version.outputs.new_version }} | ||
path: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.