Skip to content

test release workflow #37

test release workflow

test release workflow #37

name: Release Mikupad
on:
push:
tags:
- '*'
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Determine Tag Name
id: Tag_Name
run: |
BUILD_NUMBER="$(git rev-list --count HEAD)"
echo "number=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
SHORT_HASH="$(git rev-parse --short=7 HEAD)"
echo "buildName=miku${BUILD_NUMBER} ${SHORT_HASH}" >> $GITHUB_OUTPUT
echo ${BUILD_NUMBER}
echo ${SHORT_HASH}
- name: Get Last Release Tag
id: last_release
run: |
echo "tag=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo 'none')" >> $GITHUB_OUTPUT
- name: Generate Changelog
id: changelog
run: |
if [ "${{ steps.last_release.outputs.tag }}" = "none" ]; then
echo "mikudayo~" > CHANGELOG.txt
else
LAST_TAG=$(git describe --tags --abbrev=0 HEAD^)
echo "Generating changelog from $LAST_TAG"
echo "$(git log $LAST_TAG..HEAD --oneline)" > CHANGELOG.txt
fi
echo "body=$(cat CHANGELOG.txt)" >> $GITHUB_OUTPUT
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.Tag_Name.outputs.number }}
name: Miku${{ steps.Tag_Name.outputs.buildName }}
body_path: CHANGELOG.txt
files: mikupad_compiled.html
token: ${{ secrets.GITHUB_TOKEN }}