chore: comments #166
This file contains 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: Run release-please | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: "npm" | |
- run: npm ci | |
- run: npm run dist | |
- name: Prepare production archive of package.json, package-lock.json and dist directory | |
run: | | |
mkdir -p output | |
tar -czvf output/build.tar.gz package.json package-lock.json ecosystem.config.js dist | |
- uses: googleapis/release-please-action@v4 | |
id: release | |
with: | |
token: ${{ secrets.GH_RELEASE_TOKEN }} | |
- name: Upload Release Artifact | |
if: ${{ steps.release.outputs.release_created }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release upload ${{ steps.release.outputs.tag_name }} ./output/build.tar.gz | |
- uses: actions/checkout@v4 | |
- name: tag major and minor versions | |
if: ${{ steps.release.outputs.release_created }} | |
run: | | |
git config user.name "${{ github.actor }}" | |
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" | |
git remote add gh-token "https://${{ secrets.GH_RELEASE_TOKEN }}@github.com/${{ github.repository }}.git" | |
git tag -d v${{ steps.release.outputs.major }} || true | |
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true | |
git push origin :v${{ steps.release.outputs.major }} || true | |
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true | |
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}" | |
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}" | |
git push origin v${{ steps.release.outputs.major }} | |
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} |