2024-02-13 06:05:36 +00:00
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
2024-04-05 16:43:50 +00:00
|
|
|
workflow_run:
|
|
|
|
workflows: [build]
|
|
|
|
types:
|
|
|
|
- completed
|
2024-02-13 06:05:36 +00:00
|
|
|
|
2024-03-16 17:07:12 +00:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
2024-02-13 06:05:36 +00:00
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
2024-04-02 06:45:34 +00:00
|
|
|
with:
|
2024-04-05 13:50:26 +00:00
|
|
|
fetch-depth: 0
|
|
|
|
ref: ${{ github.ref }}
|
2024-02-13 06:05:36 +00:00
|
|
|
|
|
|
|
- name: Setup python
|
|
|
|
uses: actions/setup-python@v5
|
|
|
|
with:
|
|
|
|
python-version: "3.11"
|
|
|
|
|
2024-04-02 06:45:34 +00:00
|
|
|
- name: Read version from project config
|
|
|
|
id: read_toml
|
|
|
|
uses: SebRollen/toml-action@v1.0.2
|
|
|
|
with:
|
|
|
|
file: project.toml
|
|
|
|
field: project.version
|
|
|
|
|
2024-02-13 06:05:36 +00:00
|
|
|
- name: Replace template
|
|
|
|
run: python3 scripts/replace-template.py
|
|
|
|
|
|
|
|
- name: Commit changes
|
2024-03-16 17:55:44 +00:00
|
|
|
uses: EndBug/add-and-commit@v7
|
2024-02-13 06:05:36 +00:00
|
|
|
with:
|
2024-04-02 06:45:34 +00:00
|
|
|
message: '[Release] ${{ steps.read_toml.outputs.value }}'
|
2024-03-16 17:55:44 +00:00
|
|
|
pull_strategy: 'NO-PULL'
|
|
|
|
push: false
|
|
|
|
|
|
|
|
- name: Push changes
|
|
|
|
run: |
|
|
|
|
git pull --rebase
|
2024-04-02 06:45:34 +00:00
|
|
|
git push
|
2024-02-13 06:05:36 +00:00
|
|
|
|
|
|
|
- name: Bump version and push tag
|
|
|
|
id: tag_version
|
|
|
|
uses: mathieudutour/github-tag-action@v6.1
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
custom_tag: ${{ steps.read_toml.outputs.value }}
|
|
|
|
|
|
|
|
- name: Create a GitHub release
|
|
|
|
uses: ncipollo/release-action@v1
|
|
|
|
with:
|
|
|
|
tag: ${{ steps.tag_version.outputs.new_tag }}
|
|
|
|
name: Release ${{ steps.tag_version.outputs.new_tag }}
|
|
|
|
generateReleaseNotes: true
|