-
Notifications
You must be signed in to change notification settings - Fork 6
121 lines (98 loc) · 2.96 KB
/
ci.yml
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
name: CI
on:
push:
branches:
- main
tags:
- '!*'
pull_request:
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
container: ghcr.io/tootallnate/pacman-packages@sha256:e9000010d6de29367f842e55dc04f200184651da08f9cd6f6e8e8af0de10b914
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8.5.0
- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build dependent packages
run: pnpm build --filter @nx.js/runtime
- name: Bundle `runtime.js`
run: pnpm bundle
- name: Build `nxjs.nro`
run: make V=1
- uses: actions/upload-artifact@v4
with:
name: nxjs.nro
path: nxjs.nro
- uses: actions/upload-artifact@v4
with:
name: nxjs.nsp
path: |
build/exefs/
romfs/
icon.jpg
nxjs.nacp
release:
name: Release
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Download `nxjs.nro`
uses: actions/download-artifact@v4
with:
name: nxjs.nro
- name: Download `nxjs.nsp`
uses: actions/download-artifact@v4
with:
name: nxjs.nsp
- name: Fetch git tags
run: git fetch origin 'refs/tags/*:refs/tags/*'
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8.15.8
- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build Packages
run: pnpm build
- name: Copy `nxjs.nro` to "@nx.js/nro"
run: cp -v nxjs.nro packages/nro/dist
- name: Copy files to "@nx.js/nsp"
run: cp -rv build/exefs romfs nxjs.nacp icon.jpg packages/nsp
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: pnpm ci:version
publish: pnpm ci:publish
createGithubReleases: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub Release (if published happened)
if: steps.changesets.outputs.published == 'true'
uses: actions/github-script@v6
with:
script: |
const { createRelease } = await import('${{ github.workspace }}/.github/scripts/create-release.mjs')
await createRelease({ github, context })