-
Notifications
You must be signed in to change notification settings - Fork 11
144 lines (138 loc) · 4.37 KB
/
release.yml
File metadata and controls
144 lines (138 loc) · 4.37 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Release
on:
release:
types: [published]
permissions:
id-token: write # Required for OIDC
contents: write
jobs:
build-dashboard:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: 1.25.5
- uses: ./.github/actions/build-cli-flags-doc
- uses: ./.github/actions/build-release-notes
- uses: actions/setup-node@v4
with:
node-version: 23
registry-url: 'https://registry.npmjs.org'
- run: npm install
working-directory: ./webui
- name: Install taskfile
run: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
- name: Build
run: task build-vue-app
env:
CGO_ENABLED: 0
- name: Upload UI artifact
uses: actions/upload-artifact@v4
with:
name: dashboard
path: webui/dist
release-unix:
needs: build-dashboard
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download dashboard
uses: actions/download-artifact@v4
with:
name: dashboard
path: webui/dist
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker Login
uses: docker/login-action@v1
with:
username: marle3003
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: actions/setup-go@v5
with:
go-version: 1.25.5
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}
release-windows:
needs: build-dashboard
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download dashboard
uses: actions/download-artifact@v4
with:
name: dashboard
path: webui/dist
- uses: actions/setup-go@v5
with:
go-version: 1.25.5
- uses: actions/setup-node@v4
with:
node-version: 23
registry-url: 'https://registry.npmjs.org'
- run: choco install go-task
- name: Install goversioninfo
run: go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@v1.4.0
- name: Generate Windows metadata (.syso)
working-directory: ./cmd/mokapi
shell: pwsh
run: |
$versionParts = ($env:GITHUB_REF -replace '.*/v', '').Split('.')
'{}' | Out-File versioninfo.json -NoNewline ascii
goversioninfo -64 `
-platform-specific='true' `
-charset="1200" `
-company="Mokapi OpenSource" `
-copyright="© Marcel Lehmann. Licensed under MIT." `
-description="Your API Mocking Tool for Agile Development, using Go and JavaScript" `
-icon="../../icon.ico" `
-internal-name="mokapi" `
-original-name="mokapi.exe" `
-product-name="mokapi" `
-translation="0x0409" `
-ver-major="$($versionParts[0])" `
-ver-minor="$($versionParts[1])" `
-ver-patch="$($versionParts[2])" `
-product-version="$($versionParts[0]).$($versionParts[1]).$($versionParts[2])"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release -f .goreleaser.windows.yml --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
release-npm:
needs: build-dashboard
runs-on: ubuntu-latest
steps:
- name: Download dashboard
uses: actions/download-artifact@v4
with:
name: dashboard
path: webui/dist
- name: Install taskfile
run: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
- name: Build
run: task build-vue-app
env:
CGO_ENABLED: 0
- name: Publish
run: task publish-npm-package VERSION=${GITHUB_REF##*/v}