-
Notifications
You must be signed in to change notification settings - Fork 3
169 lines (144 loc) · 5.13 KB
/
Create_Release.yml
File metadata and controls
169 lines (144 loc) · 5.13 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Create Release
env:
project: PopEngine
AUTH_TOKEN: ${{ secrets.PACKAGE_KEY_ACTIONS }}
on:
push:
#tsdk: need this otherwise it will never make a package later on
tags:
- v*
watch:
types: [started]
jobs:
Build:
name: ${{ matrix.config.os }}
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- os: ubuntu-18.04
type: linux
arch: x86_64
- os: ubuntu-18.04
type: linux
arch: x86_64
flag: osmesa
- os: Nvidia
type: linux
arch: arm64
# - os: Pi4
# type: linux
- os: windows-latest
type: windows
# ios & osx universal build
- os: macos-latest
BuildScheme: PopEngine_Universal
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: recursive
- name: Configure Node
uses: actions/setup-node@v1
with:
registry-url: https://npm.pkg.github.com/
scope: '@newchromantics'
node-version: 12
- name: Install Github Packages
working-directory: ${{ env.project }}.Package/
run: |
npm install
npm list
env:
NODE_AUTH_TOKEN: ${{ env.AUTH_TOKEN }}
- name: Setup nuget (Windows)
if: matrix.config.os == 'windows' || matrix.config.os == 'windows-latest'
uses: nuget/setup-nuget@v1
- name: Setup msbuild (Windows)
if: matrix.config.os == 'windows' || matrix.config.os == 'windows-latest'
uses: microsoft/setup-msbuild@v1.0.2
- name: Build Windows
if: matrix.config.os == 'windows' || matrix.config.os == 'windows-latest'
uses: NewChromantics/PopAction_BuildWindows@v1
with:
BuildPlatform: x64
BuildConfiguration: Release
# would be nice to extract this from visual studio
BuildDirectory: Build\Release_x6
project: ${{ env.project }}
- name: "Import Apple-Distriubution NewChromantics Signing Certificate"
if: matrix.config.os == 'macos-latest'
uses: devbotsxyz/xcode-import-certificate@master
with:
certificate-data: ${{ secrets.APPLE_DIST_NEWCHROMANTICS_P12 }}
certificate-passphrase: ${{ secrets.APPLE_DIST_NEWCHROMANTICS_PASSWORD }}
keychain-password: "Hello"
- name: Build Apple
id: Apple
if: matrix.config.os == 'macos-latest'
uses: NewChromantics/PopAction_BuildApple@v1.0.9
with:
BuildScheme: ${{ matrix.config.BuildScheme }}
project: ${{ env.project }}
- name: Build Linux
if: matrix.config.type == 'linux'
uses: NewChromantics/PopAction_BuildLinux@v1
with:
lib_dir: ${{ matrix.config.os }}
os: ${{ matrix.config.os }}
project: ${{ env.project }}
arch: ${{ matrix.config.arch }}
flag: ${{ matrix.config.flag }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
# tsdk: these env vars are set in each of the actions
name: ${{ env.UPLOAD_NAME }}
path: ${{ env.UPLOAD_DIR }}
publish-gpr:
needs: Build
runs-on: ubuntu-latest
steps:
# Download artifacts into Packaging dir
- uses: actions/checkout@v2
- name: Download build artifacts
uses: actions/download-artifact@v2
with:
path: ${{ env.project }}.Package/
# copy files we want in the release/package into the package dir
- name: Copy files for packaging
run: |
echo Copying files into $PACKAGE_DIR
echo Project is ${{ env.project }}
echo Project2 is $project
cp Readme.md $PACKAGE_DIR
env:
PACKAGE_DIR: ${{ env.project }}.Package/
# setup node for npm packaging
- name: Make github package
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
# set dry-run if this isn't a tag so npm publish will run, but not do anything (and not fail)
- name: Set npm publish as dry-run
if: startsWith(github.ref, 'refs/tags/v') != true
run: echo "::set-env name=NPM_PACKAGE_DRY_RUN::--dry-run"
# tsdk: don't need to install anything here and can just ket the GITHUB_TOKEN work
- name: Publish
working-directory: ${{ env.project }}.Package/
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ls
npm publish $NPM_PACKAGE_DRY_RUN
# make a release
# needs to be after the npm package cause this step tars and deletes all the files in the dir which breaks it!
- name: Make github release
# only try and make a release if this is a release (to help testing npm packaging)
if: startsWith(github.ref, 'refs/tags/v')
uses: fnkr/github-action-ghr@v1
env:
GHR_COMPRESS: zip
GHR_PATH: ${{ env.project }}.Package/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}