Update release.yml #26
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: Create Release | |
on: | |
push: | |
paths: | |
- 'tildagon.toml' | |
- '.github/workflows/release.yml' | |
# tags-ignore: | |
# - 'v*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get Commits since last Release | |
id: changes | |
uses: simbo/changes-since-last-release-action@v1 | |
- name: Output collected Data | |
run: | | |
echo "Changes since ${{ steps.changes.outputs.last-tag }}:" | |
echo "${{ steps.changes.outputs.log }}" | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install toml | |
- name: Get version | |
id: get_version | |
run: | | |
{ | |
echo 'VERSION<<EOF' | |
echo "v" | |
echo $(python -c "import toml; print(toml.load('tildagon.toml')['metadata']['version'])") | |
echo EOF | |
} >> "$GITHUB_ENV" | |
- name: Print version | |
id: print_version | |
run: | | |
printf 'Version: %s\n' "$VERSION" | |
- name: Get version 2 | |
id: get_version_2 | |
run: | | |
echo ::set-output name=version::$(python -c "import toml; print(toml.load('tildagon.toml')['metadata']['version'])") | |
- name: Print version 2 | |
id: print_version_2 | |
run: | | |
printf 'Version: %s\n' "${{ steps.get_version_2.outputs.version }}" | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ steps.get_version_2.outputs.version }} | |
release_name: v${{ steps.get_version_2.outputs.version }} | |
body: | | |
Changes since ${{ steps.changes.outputs.last-tag }}: | |
${{ steps.changes.outputs.log }} | |
draft: false | |
prerelease: false |