-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (97 loc) · 2.68 KB
/
Copy pathrelease.yml
File metadata and controls
112 lines (97 loc) · 2.68 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Release
on:
push:
branches:
- main
env:
GIT_USER_EMAIL: ${{ secrets.GIT_EMAIL }}
GIT_USER_NAME: ${{ secrets.GIT_NAME }}
permissions:
contents: write
jobs:
bump_version:
if: "!startsWith(github.event.head_commit.message , 'bump:')"
runs-on: ubuntu-latest
name: 'Bump version'
outputs:
version: ${{ steps.cz.outputs.version }}
steps:
- name: Check out
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
ref: 'main'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Config Git User
run: |
git config --local user.email "$GIT_USER_EMAIL"
git config --local user.name "$GIT_USER_NAME"
git config --local pull.ff only
- id: cz
name: Create bump and changelog
run: |
python -m pip install -U commitizen
cz bump --yes
export REV=`cz version --project`
echo "version=\"v$REV\"" >> $GITHUB_OUTPUT
- name: Push changes
uses: ad-m/github-push-action@v0.8.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
repository: 'Drafteame/serverless-plugin-lambda-deployments'
branch: 'main'
directory: .
tags: true
- name: Print Version
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
npm_publish:
name: Publish to NPM
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
needs:
- bump_version
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.ACCESS_TOKEN }}
ref: main
- name: Setup NodeJS with cache
uses: Drafteame/node-cache-action@main
with:
node-version: '24'
- name: Install dependencies
run: npm install --legacy-peer-deps
- name: Publish to NPM
uses: JS-DevTools/npm-publish@v4
with:
access: public
strategy: upgrade
release:
name: Release version
runs-on: ubuntu-latest
needs:
- bump_version
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.ACCESS_TOKEN }}
ref: main
- name: Create Release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create ${{ needs.bump_version.outputs.version }} \
--title ${{ needs.bump_version.outputs.version }} \
--target main \
--verify-tag \
--latest