38 lines
1.1 KiB
YAML
38 lines
1.1 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
prepare:
|
|
if: ${{ !startsWith(github.event.head_commit.message, 'chore(release): prepare ') }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Provide lowercase changelog compatibility
|
|
run: |
|
|
set -euo pipefail
|
|
if [[ -f CHANGELOG.md && ! -e changelog.md ]]; then
|
|
ln -s CHANGELOG.md changelog.md
|
|
fi
|
|
|
|
- name: Prepare release
|
|
run: bash ./script/prepare-release.sh
|
|
|
|
- name: Summary
|
|
if: ${{ always() }}
|
|
run: |
|
|
set -euo pipefail
|
|
if git rev-parse -q --verify "refs/tags/$(sed -n 's/^const String = "\([^"]*\)"$/v\1/p' internal/homesick/version/version.go)" >/dev/null; then
|
|
echo "Prepared and pushed release tag $(sed -n 's/^const String = "\([^"]*\)"$/v\1/p' internal/homesick/version/version.go)." >> "$GITHUB_STEP_SUMMARY"
|
|
else
|
|
echo "No release prepared in this run." >> "$GITHUB_STEP_SUMMARY"
|
|
fi |