Skip to content

Update release.yml #121

Update release.yml

Update release.yml #121

Workflow file for this run

name: Release
on:
push:
branches:
- main
paths-ignore:
# - '.github/**'
- '__fixtures/**'
- '__tests__/**'
- 'TestSolution/**'
- '.tagpr'
jobs:
tagpr:
runs-on: ubuntu-latest
outputs:
pull_request: ${{ steps.tagpr.outputs.pull_request }}
tag: ${{ steps.tagpr.outputs.tag }}
steps:
- uses: actions/checkout@v4
- id: tagpr
uses: Songmu/tagpr@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
update-tag:
needs: tagpr
runs-on: ubuntu-latest
if: ${{ needs.tagpr.outputs.tag != '' }}
env:
MAJOR_TAG: v1
steps:
- uses: actions/checkout@v4
- name: Update Tag
run: |
git config --local user.email github-actions[bot]@users.noreply.github.com
git config --local user.name github-actions[bot]
git tag -fa ${{ env.MAJOR_TAG }} -m "Release ${{ steps.tagpr.outputs.tag }}"
git push --force origin ${{ env.MAJOR_TAG }}
package:
needs: tagpr
if: ${{ needs.tagpr.outputs.tag == '' && needs.tagpr.outputs.pull_request != '' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ fromJSON(needs.tagpr.outputs.pull_request).head.ref }}
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build && npm run package
- name: Commit compiled code
run: |
git config --local user.name 'github-actions[bot]'
git config --local user.mail '41898282+github-actions[bot]@users.noreply.github.com'
git diff --exit-code --quiet || (git add . && git commit -m 'Compile' && git push origin ${{ fromJSON(needs.tagpr.outputs.pull_request).head.ref }})
outputs:
tagpr_branch: ${{ fromJSON(needs.tagpr.outputs.pull_request).head.ref }}
e2e_test:
needs: package
uses: ./.github/workflows/reusable-e2e.yml
with:
branch: ${{ needs.package.outputs.tagpr_branch }}