-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (90 loc) · 2.78 KB
/
build.yml
File metadata and controls
99 lines (90 loc) · 2.78 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
name: Build
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-13, windows-latest]
steps:
- uses: actions/setup-node@v4
- uses: actions/checkout@v4
- uses: esy/github-action@master
with:
setup-esy-npm-package: 'esy'
setup-esy-version: 'latest'
source-cache-key: 20240515-1
cache-key: ${{ hashFiles('esy.lock/index.json') }}-20240515-1
- uses: esy/github-action@master
id: prepare-npm-artifacts
with:
source-cache-key: 20240515-1
cache-key: ${{ hashFiles('esy.lock/index.json') }}-20240515-1
prepare-npm-artifacts-mode: true
ocaml-compiler-version: 5.1.1000
ocaml-static-compiler-version: 5.1.1000
static-build:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
file: ./docker/DevImage.Dockerfile
push: false
tags: user/app:latest
bundle:
permissions:
contents: write
needs:
- build
- static-build
runs-on: macos-latest
steps:
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
- uses: actions/checkout@v4
with:
fetch-depth: 100
fetch-tags: true
- uses: esy/github-action@master
with:
source-cache-key: 20240515-1
cache-key: ${{ hashFiles('esy.lock/index.json') }}-20240515-1
bundle-npm-artifacts-mode: true
ocaml-compiler-version: 5.1.1000
ocaml-static-compiler-version: 5.1.1000
- name: Create tarball
run: tar cf npm-release.tgz ./_npm-release
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: npm-release.tgz
# - name: Publish to NPM registry
# working-directory: _npm-release
# run: npm publish --access=public .
# env:
# NODE_AUTH_TOKEN: ${{ secrets.YOUR_TOKEN_HERE }}
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-13, windows-latest]
needs: bundle
steps:
- uses: actions/setup-node@v4
- uses: actions/download-artifact@v4
with:
name: npm-release
- run: npm i --prefix $HOME/prefix -g ./npm-release.tgz
if: ${{ runner.os != 'Windows' }}
shell: bash
- run: echo $HOME/prefix/bin >> "$GITHUB_PATH"
if: ${{ runner.os != 'Windows' }}
shell: bash
- run: npm i -g ./npm-release.tgz
if: ${{ runner.os == 'Windows' }}
- run: hello