mirror of
https://github.com/Deutscher-Tischfussballbund/com_sportsmanager.git
synced 2026-06-10 06:27:52 +00:00
61 lines
1.8 KiB
YAML
61 lines
1.8 KiB
YAML
# This workflow will run release using node and then publish a package to GitHub Packages when a release is created
|
|
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
|
|
name: Sportsmanager Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v[0-9]+.[0-9]+.[0-9]+' # run only on version tags like v1.0.0
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: sportsmanager2-prod
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: Install npm dependencies
|
|
run: npm ci
|
|
|
|
- name: Generate release notes
|
|
id: release_notes
|
|
uses: release-drafter/release-drafter@v6
|
|
with:
|
|
config-name: release-drafter.yml
|
|
|
|
- name: Save release notes to file
|
|
run: |
|
|
echo "${{ steps.release_notes.outputs.body }}" > RELEASE_NOTES.md
|
|
|
|
- name: Configure Git
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
- name: Commit RELEASE_NOTES.md
|
|
run: |
|
|
git add RELEASE_NOTES.md
|
|
git commit -m "Update RELEASE_NOTES.md for ${{ github.ref_name }}" || echo "No changes to commit"
|
|
git push
|
|
|
|
- name: Run build script
|
|
run: npm run release
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: "${{ github.ref_name }}"
|
|
name: "Release ${{ github.ref_name }}"
|
|
files: package/packages/com_sportsmanager.zip
|
|
body_path: "RELEASE_NOTES.md"
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|