Skip to content

Commit

Permalink
test release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
neCo2 committed May 22, 2024
1 parent 7bf43b1 commit 34824e9
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions .github/workflows/compile_mikupad.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: compile mikupad

on:
push:
tags:
- '*'
branches:
- main

Expand All @@ -25,15 +27,38 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "mikudayo~[bot]"
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add -f mikupad_compiled.html
git commit -m "Update mikupad_compiled.html" || echo "No changes to commit"
git push origin main || echo "Nothing to push"
- 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: V${{ 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
with:
name: mikupad_compiled
path: mikupad_compiled.html

0 comments on commit 34824e9

Please sign in to comment.