Skip to content

Commit e977ed6

Browse files
committed
macos x64 and arm64
1 parent af7b7c5 commit e977ed6

File tree

2 files changed

+47
-9
lines changed

2 files changed

+47
-9
lines changed

.github/workflows/on-release.yml

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
types: [created]
66

77
jobs:
8-
upload-macos-release-asset:
9-
runs-on: ubuntu-latest
8+
upload-macos-arm64-release-asset:
9+
runs-on: macos-latest
1010
steps:
1111
- uses: actions/checkout@v4
1212
- uses: actions/setup-node@v4
@@ -15,10 +15,10 @@ jobs:
1515
- run: npm ci
1616
- name: Build standalone apps
1717
run: |
18-
npx pkg . -t macos --compress GZip
18+
npx pkg . -t macos-arm64 --compress GZip
1919
cd ./dist
2020
chmod 775 heta-compiler
21-
tar -czvf ./heta-compiler-macos.tar.gz ./heta-compiler
21+
tar -czvf ./heta-compiler-macos-arm64.tar.gz ./heta-compiler
2222
cd ..
2323
2424
- name: Upload Release Asset Macos
@@ -28,7 +28,7 @@ jobs:
2828
with:
2929
upload_url: ${{ github.event.release.upload_url }}
3030
asset_path: dist/heta-compiler
31-
asset_name: heta-compiler-macos-x64
31+
asset_name: heta-compiler-macos-arm64
3232
asset_content_type: application/octet-stream
3333

3434
- name: Upload Release TAR.GZ Macos
@@ -37,8 +37,8 @@ jobs:
3737
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3838
with:
3939
upload_url: ${{ github.event.release.upload_url }}
40-
asset_path: dist/heta-compiler-macos.tar.gz
41-
asset_name: heta-compiler-macos.tar.gz
40+
asset_path: dist/heta-compiler-macos-arm64.tar.gz
41+
asset_name: heta-compiler-macos-arm64.tar.gz
4242
asset_content_type: application/octet-stream
4343

4444
- name: Configure SSH
@@ -60,11 +60,48 @@ jobs:
6060
mkdir -p Formula
6161
cp -f ../build-homebrew/heta-compiler.template.rb Formula/heta-compiler.rb # copy the new formula and replace the old one
6262
sed -i "s|\$VERSION|${{ github.event.release.tag_name }}|" Formula/heta-compiler.rb
63-
SHA=$(sha256sum ../dist/heta-compiler-macos.tar.gz | awk '{print $1}')
63+
SHA=$(sha256sum ../dist/heta-compiler-macos-arm64.tar.gz | awk '{print $1}')
6464
sed -i "s|\$SHA256|$SHA|" Formula/heta-compiler.rb
6565
git add .
6666
git commit -m "Automated update from source repository based on release ${{ github.event.release.tag_name }}"
6767
git push origin master
68+
69+
upload-macos-release-asset:
70+
runs-on: macos-14
71+
steps:
72+
- uses: actions/checkout@v4
73+
- uses: actions/setup-node@v4
74+
with:
75+
node-version: 18.x
76+
- run: npm ci
77+
- name: Build standalone apps
78+
run: |
79+
npx pkg . -t macos-x64 --compress GZip
80+
cd ./dist
81+
chmod 775 heta-compiler
82+
tar -czvf ./heta-compiler-macos.tar.gz ./heta-compiler
83+
cd ..
84+
85+
- name: Upload Release Asset Macos
86+
uses: actions/upload-release-asset@v1
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
with:
90+
upload_url: ${{ github.event.release.upload_url }}
91+
asset_path: dist/heta-compiler
92+
asset_name: heta-compiler-macos-x64
93+
asset_content_type: application/octet-stream
94+
95+
- name: Upload Release TAR.GZ Macos
96+
uses: actions/upload-release-asset@v1
97+
env:
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
with:
100+
upload_url: ${{ github.event.release.upload_url }}
101+
asset_path: dist/heta-compiler-macos.tar.gz
102+
asset_name: heta-compiler-macos.tar.gz
103+
asset_content_type: application/octet-stream
104+
68105
upload-linux-release-asset:
69106
runs-on: ubuntu-latest
70107
steps:
@@ -119,6 +156,7 @@ jobs:
119156
asset_path: dist/heta-compiler-deb.deb
120157
asset_name: heta-compiler-x64.deb
121158
asset_content_type: application/octet-stream
159+
122160
upload-linux-arm64-release-asset:
123161
runs-on: ubuntu-22.04-arm
124162
steps:

build-homebrew/heta-compiler.template.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class HetaCompiler < Formula
22
desc "CLI for Heta Compiler"
33
homepage "https://hetalang.github.io/#/heta-compiler/"
4-
url "https://github.com/hetalang/heta-compiler/releases/download/$VERSION/heta-compiler-macos.tar.gz"
4+
url "https://github.com/hetalang/heta-compiler/releases/download/$VERSION/heta-compiler-macos-arm64.tar.gz"
55
sha256 "$SHA256"
66
license "Apache-2.0"
77

0 commit comments

Comments
 (0)