mirror of
https://github.com/ytliu74/obsidian-pseudocode.git
synced 2026-07-22 04:34:49 +00:00
chore: add auto-release workflow
This commit is contained in:
parent
035fabb046
commit
27bbfe3b14
2 changed files with 59 additions and 0 deletions
|
|
@ -8,3 +8,7 @@ insert_final_newline = true
|
|||
indent_style = tab
|
||||
indent_size = 4
|
||||
tab_width = 4
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_size = 2
|
||||
tab_width = 2
|
||||
|
|
|
|||
55
.github/workflows/release.yml
vendored
Normal file
55
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
name: Create Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
create_release:
|
||||
if: "contains(github.event.head_commit.message, 'new release')"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: "18"
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
- name: Get Release Version
|
||||
id: release-version
|
||||
run: |
|
||||
echo "version=${{ steps.commit.outputs.message }} | cut -d' ' -f3" >> $GITHUB_ENV
|
||||
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ env.version }}
|
||||
release_name: ${{ env.version }}
|
||||
body: "New release ${{ env.version }}"
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
- name: Upload Release Asset
|
||||
id: upload-release-asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./
|
||||
asset_name: |
|
||||
main.js
|
||||
manifest.json
|
||||
style.css
|
||||
Loading…
Reference in a new issue