-
Notifications
You must be signed in to change notification settings - Fork 43
62 lines (56 loc) · 1.87 KB
/
main-branch-push-workflow.yaml
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
name: Release
on:
push:
branches:
- main
permissions: write-all
jobs:
generate-next-semantic-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout repository
with:
submodules: true
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.8.1'
- name: semantic-release extract new version
id: extract
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm install @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/changelog @semantic-release/git semantic-release/exec
echo "version=v$(npx semantic-release --dryRun | grep -oP 'Published release \K.*? ')"
echo "version=v$(npx semantic-release --dryRun | grep -oP 'Published release \K.*? ')" >> "$GITHUB_OUTPUT"
outputs:
version: ${{ steps.extract.outputs.version }}
build-images:
needs: [generate-next-semantic-version]
uses: ./.github/workflows/build-images.yaml
with:
latest: true
push: true
tag: ${{needs.generate-next-semantic-version.outputs.version}}
ref: ${{ github.sha }}
release:
needs: [build-images]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout repository
with:
submodules: true
persist-credentials: false
ref: ${{ github.sha }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.8.1'
- name: semantic-release
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_SECRET }}
run : |
npm install @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/changelog @semantic-release/git semantic-release/exec
npx semantic-release