-
Notifications
You must be signed in to change notification settings - Fork 8
122 lines (105 loc) · 3.01 KB
/
Copy pathrelease.yml
File metadata and controls
122 lines (105 loc) · 3.01 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
name: Release CLI Binaries
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
goos: linux
goarch: amd64
ext: ''
name: ue-cli-linux-amd64
- os: ubuntu-latest
goos: linux
goarch: arm64
ext: ''
name: ue-cli-linux-arm64
- os: ubuntu-latest
goos: darwin
goarch: amd64
ext: ''
name: ue-cli-darwin-amd64
- os: ubuntu-latest
goos: darwin
goarch: arm64
ext: ''
name: ue-cli-darwin-arm64
- os: ubuntu-latest
goos: windows
goarch: amd64
ext: '.exe'
name: ue-cli-windows-amd64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Copy plugin source for embedding
run: |
mkdir -p cli/internal/project/plugin
cp UnrealMCP.uplugin cli/internal/project/plugin/
cp -r Source cli/internal/project/plugin/
- name: Build
working-directory: cli
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: '0'
run: |
VERSION="${GITHUB_REF_NAME}"
go build -ldflags "-s -w -X github.com/epicgames/ue-cli/cmd.Version=${VERSION}" \
-o "../${{ matrix.name }}${{ matrix.ext }}" .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}
path: ${{ matrix.name }}${{ matrix.ext }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: binaries
merge-multiple: true
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
binaries/ue-cli-windows-amd64.exe
binaries/ue-cli-linux-amd64
binaries/ue-cli-linux-arm64
binaries/ue-cli-darwin-amd64
binaries/ue-cli-darwin-arm64
publish-npm:
needs: release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Update npm package version from tag
working-directory: cli/npm
run: |
VERSION="${GITHUB_REF_NAME#v}"
npm version "$VERSION" --no-git-tag-version --allow-same-version
- name: Publish to npm
working-directory: cli/npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public