Skip to content

Merge branch 'main' of https://github.com/RedEyeMods/copy-labels-action #8

Merge branch 'main' of https://github.com/RedEyeMods/copy-labels-action

Merge branch 'main' of https://github.com/RedEyeMods/copy-labels-action #8

name: Automatic Distribution
on:
push:
branches:
- main
jobs:
check-diff:
runs-on: ubuntu-latest
outputs:
INDEX_CHANGED: ${{ steps.filter.outputs.index }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
base: main
filters: |
index:
- 'index.js'
release-dist:
runs-on: ubuntu-latest
needs: check-diff
if: ${{ needs.check-diff.outputs.INDEX_CHANGED == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_SIGNING_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- uses: reecetech/[email protected]
id: version
with:
scheme: calver
- name: Add Node Modules and Push
env:
checkout_branch: v${{ steps.version.outputs.major-version }}.${{ steps.version.outputs.minor-version }}.x
GH_TOKEN: ${{ github.token }}
run: |
git checkout ${{ env.checkout_branch }} 2>/dev/null || git checkout -b ${{ env.checkout_branch }}
git merge -X theirs ${{ github.event.repository.default_branch }}
npm install
git add ./node_modules -f
git commit -am "Push node modules"
git tag ${{ steps.version.outputs.version }}
git push -f --set-upstream origin ${{ env.checkout_branch }}
git push origin tag ${{ steps.version.outputs.version }}
echo '🚀 Released v${{ steps.version.outputs.version }} @ ${{ env.checkout_branch }}' >> $GITHUB_STEP_SUMMARY