Skip to content

feat: junk feat x2 (#291) #47

feat: junk feat x2 (#291)

feat: junk feat x2 (#291) #47

Workflow file for this run

name: Merge
on:
push:
branches: [main]
paths:
- 'src/**'
- 'package-lock.json'
- 'package.json'
- 'tsconfig.json'
- 'action.yml'
- '.github/workflows/merge.yml'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
release:
name: Release
env:
TEMP_BRANCH: release-${{ github.run_number }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Conventional Changelog Update
uses: TriPSs/conventional-changelog-action@v5
id: changelog
continue-on-error: true
with:
git-branch: ${{ env.TEMP_BRANCH }}
github-token: ${{ github.token }}
skip-version-file: 'true'
skip-commit: 'true'
skip-on-empty: 'true'
git-push: 'false'
pre-release: 'true'
- name: Rebuild and push the dist/ directory
run: |
npm run dist
git diff ./dist
git checkout -b ${{ env.TEMP_BRANCH }}
git add ./dist --force
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "${GITHUB_ACTOR}"
git add .
git commit -m "Rebuild dist/ directory"
git push -u origin HEAD:${{ env.TEMP_BRANCH }}
- name: Release
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ -z "${{ steps.changelog.outputs.tag }}" ]; then
echo "No tag found, exiting"
exit 1
else
echo "Creating release ${{ steps.changelog.outputs.tag }}"
gh release create ${{ steps.changelog.outputs.tag }} --title ${{ steps.changelog.outputs.tag }} --generate-notes
fi
cleanup:
name: Cleanup
if: always()
needs: release
env:
TEMP_BRANCH: release-${{ github.run_number }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cleanup
run: git push --delete origin ${{ env.TEMP_BRANCH }}