-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (60 loc) · 2.29 KB
/
release.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
name: Release
permissions:
contents: write
issues: write
pull-requests: write
on:
push:
branches:
- main
workflow_dispatch:
jobs:
release:
name: Build and Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Release
uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.RELEASE_TOKEN }}
release-type: node
- name: Build artifacts
run: |
bun build --compile --minify --target=bun-linux-x64-modern src/cli.ts --outfile tile-packer-linux-x64
bun build --compile --minify --target=bun-darwin-arm64 src/cli.ts --outfile tile-packer-macos-arm64
bun build --compile --minify --target=bun-darwin-x64-modern src/cli.ts --outfile tile-packer-macos-x64
bun build --compile --minify --target=bun-windows-x64-modern src/cli.ts --outfile tile-packer-windows-x64.exe
- name: Upload Release Artifact
if: ${{ steps.release.outputs.release_created }}
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
gh release upload ${{ steps.release.outputs.tag_name }} tile-packer-linux-x64 tile-packer-macos-arm64 tile-packer-macos-x64 tile-packer-windows-x64.exe
- name: Brew Release
if: ${{ steps.release.outputs.release_created }}
uses: Justintime50/homebrew-releaser@v1
with:
github_token: ${{ secrets.RELEASE_TOKEN }}
homebrew_owner: eknowles
homebrew_tap: tools
install: |
if Hardware::CPU.arm? && OS.mac?
bin.install "tile-packer-macos-arm64" => "tile-packer"
elsif Hardware::CPU.intel? && OS.mac?
bin.install "tile-packer-macos-x64" => "tile-packer"
elsif OS.linux?
bin.install "tile-packer-linux-x64" => "tile-packer"
end
test: 'assert_match("tile-packer ${{steps.release.outputs.tag_name}}", shell_output("#{bin}/tile-packer --version"))'
target_darwin_amd64: true
target_darwin_arm64: true
target_linux_amd64: true
update_readme_table: true
debug: false