2024-05-30 18:49:45 +02:00
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
2025-02-15 15:25:36 +01:00
|
|
|
workflow_dispatch:
|
2024-05-30 18:49:45 +02:00
|
|
|
push:
|
2025-02-15 15:45:49 +01:00
|
|
|
tags: '2*'
|
2024-05-30 18:49:45 +02:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
jobs:
|
2025-03-01 01:02:27 +01:00
|
|
|
release:
|
2025-01-03 13:35:33 +01:00
|
|
|
runs-on: antville
|
2024-05-30 18:49:45 +02:00
|
|
|
|
2024-05-30 20:03:37 +02:00
|
|
|
env:
|
2025-02-15 19:07:37 +01:00
|
|
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
2024-05-30 20:25:44 +02:00
|
|
|
LC_TIME: en_US.UTF-8
|
2024-05-30 20:03:37 +02:00
|
|
|
|
2024-05-30 18:49:45 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2025-03-01 01:02:27 +01:00
|
|
|
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
|
2024-05-30 18:49:45 +02:00
|
|
|
|
|
|
|
- name: Build with Gradle
|
|
|
|
run: ./gradlew assembleDist
|
|
|
|
|
2025-02-15 15:46:07 +01:00
|
|
|
- name: Create release
|
|
|
|
uses: actions/forgejo-release@v2
|
2025-02-15 15:25:36 +01:00
|
|
|
with:
|
|
|
|
direction: upload
|
|
|
|
url: https://code.host.antville.org
|
|
|
|
token: ${{ github.token }}
|
2025-03-01 01:02:27 +01:00
|
|
|
title: Helma ${{ github.ref_name }}
|
2025-02-15 15:25:36 +01:00
|
|
|
release-dir: build/distributions
|
2025-03-01 01:02:27 +01:00
|
|
|
release-notes: ${{ steps.create_release_notes.outputs.release_notes }}
|
2025-02-15 15:25:36 +01:00
|
|
|
verbose: true
|
|
|
|
|
2025-02-15 15:46:32 +01:00
|
|
|
- name: Create release at GitHub
|
2024-05-30 18:49:45 +02:00
|
|
|
run: |
|
2025-02-15 19:07:37 +01:00
|
|
|
gh release create "$GITHUB_REF_NAME" \
|
2024-05-30 18:49:45 +02:00
|
|
|
--repo "$GITHUB_REPOSITORY" \
|
2025-03-01 01:02:27 +01:00
|
|
|
--title "Helma ${{ github.ref_name }}" \
|
|
|
|
--notes "${{ steps.create_release_notes.outputs.release_notes }}"
|
2024-05-30 18:49:45 +02:00
|
|
|
|
2025-02-15 15:46:32 +01:00
|
|
|
- name: Upload release assets to GitHub
|
2024-05-30 18:49:45 +02:00
|
|
|
run: |
|
2025-02-15 19:07:37 +01:00
|
|
|
gh release upload "$GITHUB_REF_NAME" build/distributions/helma-*.* \
|
|
|
|
--repo "$GITHUB_REPOSITORY" \
|
2024-05-30 18:49:45 +02:00
|
|
|
--clobber
|