generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (78 loc) · 2.33 KB
/
test.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: 'build-test'
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
- 'releases/*'
jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
npm install
- run: |
npm run all
# test: # make sure the action works on a clean machine without building
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Configure AWS
# uses: aws-actions/configure-aws-credentials@v2
# with:
# aws-access-key-id: ${{ secrets.DESTINATION_AWS_ACCESS_KEY_ID}}
# aws-secret-access-key: ${{ secrets.DESTINATION_AWS_SECRET_KEY }}
# aws-region: us-east-1
# role-to-assume: ${{ secrets.DESTINATION_ROLE }}
# role-skip-session-tagging: true
# mask-aws-account-id: false
# role-duration-seconds: 900
# - uses: ./
# with:
# action: copy
# source-account-id: ${{ secrets.SOURCE_ACCOUNT_ID }}
# source-role-arn: ${{ secrets.SOURCE_ROLE }}
# repository: ${{ secrets.REPOSITORY }}
# tag: ${{ secrets.TAG }}
release:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Release
uses: cycjimmy/semantic-release-action@v3
id: semantic-release
with:
extra_plugins: |
@semantic-release/exec
@semantic-release/changelog
@semantic-release/git
branches: |
[
"+([0-9])?(.{+([0-9]),x}).x",
"main",
"next",
"next-major",
{
"name": "beta",
"prerelease": true
},
{
"name": "alpha",
"prerelease": true
}
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Move major version tag
if: steps.semantic-release.outputs.new_release_published == 'true'
env:
VERION_TAG: v${{steps.semantic-release.outputs.new_release_major_version}}
run: |
git tag -d ${{ env.VERION_TAG }}
git push origin :${{ env.VERION_TAG }}
git tag ${{ env.VERION_TAG }}
git push origin ${{ env.VERION_TAG }}