test release workflow #31
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
name: Release Mikupad | |
on: | |
push: | |
tags: | |
- '*' | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: run compile.sh | |
run: chmod +x compile.sh; ./compile.sh | |
- name: Get Commit Count | |
id: commit_count | |
run: echo "::set-output name=count::$(git rev-list --count HEAD)" | |
- name: Get Last Release Tag | |
id: last_release | |
run: echo "::set-output name=tag::$(git describe --tags --abbrev=0 HEAD^)" | |
- name: Generate Changelog | |
id: changelog | |
run: | | |
LAST_TAG=$(git describe --tags --abbrev=0 HEAD^) | |
echo "Generating changelog from $LAST_TAG" | |
echo "$(git log $LAST_TAG..HEAD --oneline)" > CHANGELOG.txt | |
echo "::set-output name=body::$(cat CHANGELOG.txt)" | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: v${{ steps.commit_count.outputs.count }} | |
name: Miku${{ steps.commit_count.outputs.count }} | |
body: ${{ steps.changelog.outputs.body }} | |
files: mikupad_compiled.html | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 |