linutil/.github/workflows/pre-release.yaml

65 lines
1.8 KiB
YAML
Raw Normal View History

2024-07-14 01:14:19 +01:00
name: Pre-Release LinUtil
2024-07-14 01:36:04 +01:00
permissions:
contents: write # Grant write permissions to contents
packages: write # Grant write permissions to packages
2024-07-14 01:36:04 +01:00
2024-07-14 01:14:19 +01:00
on:
workflow_dispatch: # Manual trigger added
2024-08-23 00:12:15 +01:00
workflow_run:
workflows: ["LinUtil Release"]
types:
- completed
2024-07-14 01:14:19 +01:00
jobs:
build-runspace:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Extract Version
id: extract_version
run: |
version=$(date +"%Y.%m.%d")
2024-07-18 22:39:44 +01:00
echo "version=$version" >> $GITHUB_ENV
2024-07-14 01:14:19 +01:00
shell: bash
2024-08-29 05:52:38 +01:00
- name: Generate Release Notes
id: generate_notes
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
config-name: release-drafter.yml
version: ${{ env.version }}
2024-08-29 06:38:47 +01:00
version-template: '$YEAR.$MONTH.$DAY'
2024-08-29 05:52:38 +01:00
- name: Prepare Release Body
id: prepare_body
run: |
new_changes="${{ steps.generate_notes.outputs.body }}"
2024-08-29 06:07:29 +01:00
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "$new_changes" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
2024-08-29 05:52:38 +01:00
2024-07-14 01:14:19 +01:00
- name: Create and Upload Release
id: create_release
uses: softprops/action-gh-release@v2
with:
2024-07-18 22:53:40 +01:00
tag_name: ${{ env.version }}
name: Pre-Release ${{ env.version }}
2024-08-29 05:52:38 +01:00
body: |
${{ steps.prepare_body.outputs.body }}
![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/linutil/${{ env.version }}/linutil)
2024-07-18 21:44:20 +01:00
append_body: false
2024-07-14 02:07:34 +01:00
files: |
2024-07-31 11:42:27 +01:00
./build/linutil
2024-08-29 05:06:59 +01:00
./start.sh
./startdev.sh
2024-07-14 01:14:19 +01:00
prerelease: true
env:
2024-07-18 22:53:40 +01:00
version: ${{ env.version }}
2024-08-29 05:06:59 +01:00
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}