fix: adjust workflows structure to .github directory at repo root #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Reusable Release Workflow | ||
| 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 | ||