-
-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (48 loc) · 2.17 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: workflow_dispatch
# Necessary to deploy to AWS using OIDC
# https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services
permissions:
id-token: write # This is required for requesting the JWT
# To allow creating the GitHub release
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# So that we can create git commits
fetch-depth: 0
# Set git credentials (https://github.com/actions/checkout/issues/13#issuecomment-724415212)
- name: Set Git credentials
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Set AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::534081306603:role/bref-layer-js-github-actions
role-session-name: bref-layer-js-github-actions
aws-region: us-east-1
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm run update
- run: git commit -am "Update layer versions"
- name: Bump the version
run: npm version patch
- name: Push the new commit and git tag
run: git push origin && git push origin --tags
- run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
- name: Retrieve the new NPM version
id: npm-version
uses: martinbeentjes/npm-get-version-action@main
- name: Create a GitHub release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{steps.npm-version.outputs.current-version}}