mirror of
https://github.com/gofiber/storage.git
synced 2025-12-24 13:29:30 +08:00
60 lines
2.1 KiB
YAML
60 lines
2.1 KiB
YAML
name: Release Drafter (All)
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- main
|
|
|
|
jobs:
|
|
changes:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pull-requests: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Generate filters
|
|
id: filter-setup
|
|
run: |
|
|
filters=$(find . -maxdepth 1 -type d ! -path ./.git ! -path . -exec basename {} \; | grep -v '^\.' | awk '{printf "%s: \"%s/**\"\n", $1, $1}')
|
|
echo "filters<<EOF" >> $GITHUB_OUTPUT
|
|
echo "$filters" >> $GITHUB_OUTPUT
|
|
echo "EOF" >> $GITHUB_OUTPUT
|
|
shell: bash
|
|
- name: Filter changes
|
|
id: filter
|
|
uses: dorny/paths-filter@v3
|
|
with:
|
|
filters: ${{ steps.filter-setup.outputs.filters }}
|
|
|
|
outputs:
|
|
packages: ${{ steps.filter.outputs.changes || '[]' }}
|
|
|
|
release-drafter:
|
|
needs: changes
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
if: needs.changes.outputs.packages != '[]' # Ensure job runs only if there are changes
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
strategy:
|
|
matrix:
|
|
package: ${{ fromJSON(needs.changes.outputs.packages || '[]') }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Generate dynamic config from template
|
|
run: |
|
|
folder="${{ matrix.package }}"
|
|
sed "s|{{FOLDER}}|$folder|g" .github/release-drafter-template.yml > .github/release-drafter-$folder.yml
|
|
echo "Generated config for folder: $folder"
|
|
cat .github/release-drafter-$folder.yml
|
|
|
|
- name: Use dynamic release-drafter configuration
|
|
uses: release-drafter/release-drafter@v6
|
|
with:
|
|
config-name: release-drafter-${{ matrix.package }}.yml
|