-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (73 loc) · 2.17 KB
/
Copy pathrelease.yml
File metadata and controls
89 lines (73 loc) · 2.17 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
name: Build & Release
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
name: Create release
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: codeshelldev/gh-actions/go-build@v1.0.3
with:
platforms: linux/amd64,linux/arm64,darwin/amd64,windows/amd64
output-pattern: dist/goplater-${{ github.event.release.tag_name }}-{os}-{arch}
build-args: |
Version=${{ github.event.release.tag_name }}
Commit=${{ github.sha }}
- uses: actions/upload-artifact@v4
with:
name: go-binaries
path: dist/*
gh-release:
name: Attach to release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: go-binaries
path: dist
- uses: codeshelldev/gh-actions/gh-releaser@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag-name: ${{ github.event.release.tag_name }}
input-pattern: dist/{name}-${{ github.event.release.tag_name }}-{os}-{arch}
output-pattern: "{name}-${{ github.event.release.tag_name }}-{os}-{arch}"
npm:
name: Release to npm
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "24.x"
registry-url: https://registry.npmjs.org
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: go-binaries
path: dist
- name: Publish npm package
run: |
cp -r dist/* npm/bin/
chmod +x -R npm/bin/
cp README.md npm/
cp LICENSE npm/
cd npm/
npm version ${{ github.event.release.tag_name }} --no-git-tag-version
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PCKG_TOKEN }}