generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 19
61 lines (61 loc) · 1.96 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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 }}