-
Notifications
You must be signed in to change notification settings - Fork 3
92 lines (92 loc) · 3.47 KB
/
Copy pathcli-deploy.yml
File metadata and controls
92 lines (92 loc) · 3.47 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
name: create-bun-exe
on:
workflow_dispatch:
inputs:
tag:
commit:
default: 'master'
permissions:
contents: read
jobs:
bun-build:
name: build-${{ matrix.name }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- name: windows-x64
runner: windows-latest
bun_target: bun-windows-x64
bin_relpath: out/windows64/anywaydata.exe
zip_name: windows64.zip
smoke_command: .\out\windows64\anywaydata.exe --help
bun_build_flags: --compile --minify --sourcemap
- name: linux-x64
runner: ubuntu-latest
bun_target: bun-linux-x64
bin_relpath: out/linux-x64/anywaydata
zip_name: linux-x64.zip
smoke_command: ./out/linux-x64/anywaydata --help
bun_build_flags: --compile
- name: linux-arm64
runner: ubuntu-24.04-arm
bun_target: bun-linux-arm64
bin_relpath: out/linux-arm64/anywaydata
zip_name: linux-arm64.zip
smoke_command: ./out/linux-arm64/anywaydata --help
bun_build_flags: --compile
- name: macos-arm64
runner: macos-latest
bun_target: bun-darwin-arm64
bin_relpath: out/macos-arm64/anywaydata
zip_name: macos-arm64.zip
smoke_command: ./out/macos-arm64/anywaydata --help
bun_build_flags: --compile
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: 1.2.10
- name: install dependencies
run: bun install
- name: build binary
shell: bash
run: |
bun build ./apps/cli/src/bun-entry.js ${{ matrix.bun_build_flags }} --target=${{ matrix.bun_target }} --outfile "${{ github.workspace }}/${{ matrix.bin_relpath }}"
- name: smoke test binary
run: ${{ matrix.smoke_command }}
- name: package zip (windows)
if: runner.os == 'Windows'
shell: powershell
run: Compress-Archive -Path "${{ github.workspace }}\${{ matrix.bin_relpath }}" -DestinationPath "${{ github.workspace }}\${{ matrix.zip_name }}" -Force
- name: package zip (non-windows)
if: runner.os != 'Windows'
shell: bash
run: zip -j "${{ github.workspace }}/${{ matrix.zip_name }}" "${{ github.workspace }}/${{ matrix.bin_relpath }}"
- name: upload zip artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ matrix.zip_name }}
path: ${{ github.workspace }}/${{ matrix.zip_name }}
if-no-files-found: error
create-draft-release:
name: create-draft-release
needs: bun-build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: download built zips
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: ${{ github.workspace }}/release-assets
- uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0
with:
tag: ${{ inputs.tag }}
commit: ${{ inputs.commit }}
name: Draft Release ${{ github.ref }}
draft: true
artifacts: ${{ github.workspace }}/release-assets/**/*.zip
body: 'AnyWayData CLI versions'
allowUpdates: true