helma/.github/workflows/release.yml

60 lines
1.6 KiB
YAML
Raw Normal View History

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:
tags: '2*'
2024-05-30 18:49:45 +02:00
permissions:
contents: write
jobs:
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:
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
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
- 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 }}
title: Helma ${{ github.ref_name }}
2025-02-15 15:25:36 +01:00
release-dir: build/distributions
release-notes: ${{ steps.create_release_notes.outputs.release_notes }}
2025-02-15 15:25:36 +01:00
verbose: true
- name: Create release at GitHub
2024-05-30 18:49:45 +02:00
run: |
gh release create "$GITHUB_REF_NAME" \
2024-05-30 18:49:45 +02:00
--repo "$GITHUB_REPOSITORY" \
--title "Helma ${{ github.ref_name }}" \
--notes "${{ steps.create_release_notes.outputs.release_notes }}"
2024-05-30 18:49:45 +02:00
- name: Upload release assets to GitHub
2024-05-30 18:49:45 +02:00
run: |
gh release upload "$GITHUB_REF_NAME" build/distributions/helma-*.* \
--repo "$GITHUB_REPOSITORY" \
2024-05-30 18:49:45 +02:00
--clobber