Skip to content

fix: adjust workflows structure to .github directory at repo root #1

fix: adjust workflows structure to .github directory at repo root

fix: adjust workflows structure to .github directory at repo root #1

name: Reusable Release Workflow

Check failure on line 1 in .github/workflows/release-publish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release-publish.yml

Invalid workflow file

(Line: 11, Col: 1): 'on' is already defined
on:
workflow_call:
inputs:
cliff-config:
description: 'Path to changelog configuration file'
required: true
type: string
on:
workflow_call:
inputs:
cliff-config:
description: 'Path to git-cliff config file'
required: false
type: string
default: '.github/cliff.toml'
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
#--------------------------------------------------
# Setup Steps
#--------------------------------------------------
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Download binary artifacts
uses: actions/download-artifact@v7
with:
pattern: "*-binaries"
path: ./packages
merge-multiple: true
#--------------------------------------------------
# Changelog Generation
#--------------------------------------------------
- name: Generate changelog
uses: orhun/git-cliff-action@v4
id: git-cliff
with:
config: ${{ inputs.cliff-config }}
args: --latest --strip header
env:
GITHUB_REPO: ${{ github.repository }}
#--------------------------------------------------
# Release Publishing
#--------------------------------------------------
- name: Create and publish release
if: startsWith(github.ref, 'refs/tags/v')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ github.ref_name }}
run: |
# Create draft release with changelog
gh release create "$TAG_NAME" --draft --notes "${{ steps.git-cliff.outputs.content }}"
# Upload all package files
find ./packages -type f -exec gh release upload "$TAG_NAME" {} \;
# Upload LICENSE file
gh release upload "$TAG_NAME" LICENSE
# Publish the release (change from draft to published)
gh release edit "$TAG_NAME" --draft=false