调试action #137
Workflow file for this run
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 | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: build | |
run: | | |
mkdir /home/runner/work/publish/ | |
sed -i "s/\:.*/:$(git describe --tags | sed 's/v//')/" clashg/version | |
cat clashg/version | |
ls -lah | |
cd .. | |
tar -zcf clashg.tar.gz --exclude=clashg/.git --exclude=clashg/.github clashg | |
pwd | |
ls -lah | |
echo ~ | |
ls -lah ~/work/clashg/clashg.tar.gz | |
mv ~/work/clashg/clashg.tar.gz /home/runner/work/publish/ | |
- name: Get tags | |
run: | | |
git fetch --tags | |
echo "CURRENTVERSION=$(git tag | sort -V | tail -n 1)" >> $GITHUB_ENV | |
echo "PREVERSION=$(git tag | sort -V | tail -n 2 | head -n 1)" >> $GITHUB_ENV | |
- name: Generate release notes | |
run: | | |
echo "## What's Changed" > release.md | |
echo ${PREVERSION}...${CURRENTVERSION} | |
git log --pretty=format:"* %h %s by @%an" -i ${PREVERSION}...${CURRENTVERSION} | sort -f | uniq >> release.md | |
echo "" >> release.md | |
cat release.md | |
- name: Upload Release | |
uses: softprops/action-gh-release@v1 | |
if: ${{ success() && startsWith(github.ref, 'refs/tags/')}} | |
with: | |
tag: ${{ github.ref }} | |
files: /home/runner/work/publish/* | |
generate_release_notes: true | |
body_path: release.md |