-
Notifications
You must be signed in to change notification settings - Fork 39
74 lines (62 loc) · 1.7 KB
/
build-release.yaml
File metadata and controls
74 lines (62 loc) · 1.7 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
name: build-release
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Repo checkout
uses: actions/checkout@v4
- name: Bump version and push tag
id: bump
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_branches: main
- name: Release tag
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.bump.outputs.new_tag }}
generateReleaseNotes: true
publish-npmjs:
runs-on: ubuntu-latest
needs: [release]
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm install
- name: Publish package
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
release-github:
runs-on: ubuntu-latest
needs: [release]
permissions:
contents: read
id-token: write
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '24.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@hostinger'
- name: Install dependencies
run: npm install
- name: Publish package
run: |
sed -i 's+"name": ".*+"name": "@${{ github.repository }}",+gI' ./package.json
npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}