mirror of
https://github.com/wfxr/forgit.git
synced 2026-09-10 07:16:23 -04:00
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2 to 3. - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/softprops/action-gh-release/compare/v2...v3) --- updated-dependencies: - dependency-name: softprops/action-gh-release dependency-version: '3' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
78 lines
2.5 KiB
YAML
78 lines
2.5 KiB
YAML
name: Release
|
|
|
|
on:
|
|
schedule:
|
|
# Run on every first day of the month
|
|
- cron: '0 0 1 * *'
|
|
push:
|
|
tags:
|
|
- '**'
|
|
|
|
jobs:
|
|
|
|
changelog:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set version
|
|
id: set_version
|
|
# Set version depending on whether this is a regular monthly release or
|
|
# a custom release triggered by a tag push.
|
|
run: |
|
|
if [ "${{ github.event_name }}" == "push" ]; then
|
|
VERSION=${{ github.ref_name }}
|
|
else
|
|
VERSION=$(date +'%y.%m.0')
|
|
fi
|
|
echo "VERSION=$VERSION"
|
|
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Generate Changelog
|
|
id: changelog
|
|
uses: orhun/git-cliff-action@v4
|
|
with:
|
|
config: cliff.toml
|
|
# Consider the changes from the pushed tag (latest) when running due to a
|
|
# tag push and consider unreleased changes when this is a regular monthly
|
|
# release. This is necessary, because on monthly releases, the tag is created later.
|
|
args: --verbose $( [ "${{github.event_name }}" == "push" ] && echo --latest || echo --unreleased --tag ${{ steps.set_version.outputs.VERSION }} )
|
|
env:
|
|
OUTPUT: CHANGELOG.md
|
|
GITHUB_REPO: ${{ github.repository }}
|
|
|
|
- name: Check Changelog
|
|
id: check_changelog
|
|
# Test if the changelog contains any entries
|
|
run: test -n "${{ steps.changelog.outputs.content }}"
|
|
continue-on-error: true
|
|
|
|
outputs:
|
|
changeLogOutcome: ${{ steps.check_changelog.outcome }}
|
|
changelog: ${{ steps.changelog.outputs.content }}
|
|
version: ${{ steps.set_version.outputs.VERSION }}
|
|
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
needs: changelog
|
|
if: needs.changelog.outputs.changeLogOutcome == 'success'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Create Package
|
|
run: tar -czf forgit-${{ needs.changelog.outputs.version }}.tar.gz --exclude LICENSE --exclude README.md --exclude cliff.toml ./*
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v3
|
|
with:
|
|
# The release action implicitly creates the tag if it does not exist.
|
|
tag_name: ${{ needs.changelog.outputs.version }}
|
|
body: ${{ needs.changelog.outputs.changelog }}
|
|
files: forgit-${{ needs.changelog.outputs.version }}.tar.gz
|