mirror of
https://github.com/MikeWang000000/Natter.git
synced 2025-12-24 11:51:05 +08:00
56 lines
1.7 KiB
YAML
56 lines
1.7 KiB
YAML
name: Release
|
|
run-name: Release ${{ github.event.inputs.version }}
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: Version Number
|
|
type: string
|
|
required: true
|
|
|
|
jobs:
|
|
Build:
|
|
uses: ./.github/workflows/ci.yml
|
|
|
|
Release:
|
|
permissions:
|
|
contents: write
|
|
runs-on: ubuntu-latest
|
|
needs: Build
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
- name: Check version string
|
|
run: |
|
|
VERSION=$(python3 natter.py --version | cut -d' ' -f2)
|
|
test "$VERSION" = '${{ github.event.inputs.version }}' || {
|
|
echo "Version string mismatch: $VERSION != ${{ github.event.inputs.version }}" >&2
|
|
exit 1
|
|
}
|
|
- name: Download Artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: ${{ github.workspace }}/artifacts
|
|
- name: Reorganize files
|
|
run: |
|
|
mkdir release
|
|
cd artifacts
|
|
chmod a+x */natter* */compressed/natter*
|
|
for triplet in *; do
|
|
tar czvf "../release/$triplet.tar.gz" "$triplet"
|
|
done
|
|
- name: Make a tag
|
|
run: |
|
|
git config user.name 'GitHub Actions'
|
|
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
|
|
git tag -a '${{ github.event.inputs.version }}' -m '${{ github.event.inputs.version }}'
|
|
git push origin '${{ github.event.inputs.version }}'
|
|
- name: Make a release
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
run: |
|
|
gh release create --title 'v${{ github.event.inputs.version }}' --generate-notes --verify-tag '${{ github.event.inputs.version }}' natter.py release/*.tar.gz
|