Files
QuickWrt/.github/workflows/release.yml
2025-10-24 16:05:36 +08:00

57 lines
1.3 KiB
YAML

name: Release QuickWrt
on:
push:
branches:
- master
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Git
run: |
git fetch --tags
- name: Get next version
id: version
run: |
latest_tag=$(git tag --list "v*" | sort -V | tail -n1)
if [ -z "$latest_tag" ]; then
next_tag="v2.0"
else
base=${latest_tag#v}
major=$(echo $base | cut -d. -f1)
minor=$(echo $base | cut -d. -f2)
if [ "$minor" -eq 20 ]; then
next_major=$((major + 1))
next_minor=0
else
next_major=$major
next_minor=$((minor + 1))
fi
next_tag="v${next_major}.${next_minor}"
fi
echo "next_tag=$next_tag" >> $GITHUB_ENV
echo "Next version: $next_tag"
- name: Create archive
run: |
git archive --format=tar.gz -o QuickWrt.tar.gz HEAD
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.next_tag }}
name: ${{ env.next_tag }}
files: QuickWrt.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}