59 lines
1.6 KiB
YAML
59 lines
1.6 KiB
YAML
name: Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags: '2*'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: antville
|
|
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
LC_TIME: en_US.UTF-8
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Create release notes
|
|
id: create_release_notes
|
|
run: |
|
|
release_notes=$(npx git-cliff@latest --latest)
|
|
# Write the release notes as a heredoc to the workflow output
|
|
# ⚠️ No white space around `<<` is crucial!
|
|
echo "release_notes<<.eot0x03" >> $GITHUB_OUTPUT
|
|
echo "$release_notes" >> $GITHUB_OUTPUT
|
|
echo ".eot0x03" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build with Gradle
|
|
run: ./gradlew assembleDist
|
|
|
|
- name: Create release
|
|
uses: actions/forgejo-release@v2
|
|
with:
|
|
direction: upload
|
|
url: https://code.host.antville.org
|
|
token: ${{ github.token }}
|
|
title: Helma ${{ github.ref_name }}
|
|
release-dir: build/distributions
|
|
release-notes: ${{ steps.create_release_notes.outputs.release_notes }}
|
|
verbose: true
|
|
|
|
- name: Create release at GitHub
|
|
run: |
|
|
gh release create "$GITHUB_REF_NAME" \
|
|
--repo "$GITHUB_REPOSITORY" \
|
|
--title "Helma ${{ github.ref_name }}" \
|
|
--notes "${{ steps.create_release_notes.outputs.release_notes }}"
|
|
|
|
- name: Upload release assets to GitHub
|
|
run: |
|
|
gh release upload "$GITHUB_REF_NAME" build/distributions/helma-*.* \
|
|
--repo "$GITHUB_REPOSITORY" \
|
|
--clobber
|