75 lines
1.8 KiB
YAML
75 lines
1.8 KiB
YAML
name: release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
concurrency:
|
|
group: release
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
resolve:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
sha: ${{ steps.checkout.outputs.commit }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
id: checkout
|
|
with:
|
|
ref: master
|
|
|
|
checks:
|
|
needs: resolve
|
|
uses: ./.github/workflows/checks.yml
|
|
with:
|
|
network-tests: true
|
|
ref: ${{ needs.resolve.outputs.sha }}
|
|
secrets:
|
|
curseforge-api-key: ${{ secrets.CURSEFORGE_API_KEY }}
|
|
|
|
prepare:
|
|
needs: [resolve, checks]
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
release: ${{ steps.version.outputs.release }}
|
|
tag: ${{ steps.version.outputs.tag }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
ref: ${{ needs.resolve.outputs.sha }}
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
|
|
- name: check version
|
|
id: version
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
version=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "rmcl") | .version')
|
|
python3 scripts/release-version.py --check
|
|
python3 scripts/release-version.py "$version"
|
|
|
|
- name: create tag
|
|
if: steps.version.outputs.release == 'true'
|
|
env:
|
|
TAG: ${{ steps.version.outputs.tag }}
|
|
run: |
|
|
git config user.name github-actions[bot]
|
|
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
|
git tag --annotate "$TAG" --message "Release $TAG"
|
|
git push origin "$TAG"
|
|
|
|
publish:
|
|
needs: prepare
|
|
if: needs.prepare.outputs.release == 'true'
|
|
uses: ./.github/workflows/build-release.yml
|
|
with:
|
|
tag: ${{ needs.prepare.outputs.tag }}
|
|
secrets: inherit
|
|
permissions:
|
|
contents: write
|