Skip to content

Merge pull request #406 from muno92/tagpr-from-1.7.2 #54

Merge pull request #406 from muno92/tagpr-from-1.7.2

Merge pull request #406 from muno92/tagpr-from-1.7.2 #54

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@v3
- 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@v3
- 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@v3
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 '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 }})
e2e_test:
needs: package
uses: ./.github/workflows/reusable-e2e.yml