Skip to content

Commit

Permalink
build: build for mac
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickDinh committed Mar 26, 2024
1 parent c9bd814 commit 8c3b875
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 20 deletions.
37 changes: 37 additions & 0 deletions .github/actions/build-mac/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: 'Build for Mac'
inputs:
production-release:
description: 'Production release?'
required: true
release-version:
description: 'The release version'

runs:
using: 'composite'
steps:
# TODO: set up signing certs here when releasing to production

- name: Get artifact name
id: set-env
run: |
echo "artifact_name=algokit-explorer-mac-${{ runner.arch }}" >> $GITHUB_OUTPUT
shell: bash

- name: Bump version in tauri.conf.json
if: ${{ inputs.release-version != '' }}
run: |
sed -i '' "s/\"version\": \"0.0.0\"/\"version\": \"${{ inputs.release-version }}\"/g" "src-tauri/tauri.conf.json"
shell: bash

- name: Build tauri app
run: |
npm run tauri build
shell: bash

- name: Upload binary as artifact
id: upload-artifact
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ steps.set-env.outputs.artifact_name }}
path: src-tauri/target/release/bundle/dmg/algokit-explorer_*.dmg
18 changes: 0 additions & 18 deletions .github/actions/build-windows/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,10 @@ runs:
npm run tauri build
shell: bash

# - name: Move binary to target directory
# run: |
# mkdir -p windows-dist
# mv src-tauri/target/release/*.msi windows-dist/
# shell: bash

# - name: HACK - move binary to target directory
# run: |
# mkdir -p tauri-dist
# cp src/assets/react.svg tauri-dist/algokit-explorer
# chmod +x tauri-dist/algokit-explorer
# shell: bash

- name: Upload binary as artifact
id: upload-artifact
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ steps.set-env.outputs.artifact_name }}
path: src-tauri/target/release/bundle/msi/algokit-explorer_*.msi

outputs:
artifact-name:
description: 'The name of the artifact'
value: ${{ steps.set-env.outputs.artifact_name }}
12 changes: 10 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ jobs:
runs-on: ${{ matrix.platform }}
strategy:
matrix:
platform: [ubuntu-20.04, windows-latest]
# macos-14 is the Apple Silicon M1 runner
platform: [ubuntu-20.04, windows-latest, 'macos-latest', 'macos-14']
if: ${{ needs.create-release.outputs.release-published == 'true' }}

steps:
Expand Down Expand Up @@ -110,9 +111,16 @@ jobs:
with:
production-release: ${{ inputs.production-release }}
release-version: ${{ needs.create-release.outputs.release-version }}

- name: Build for Mac
id: build-mac
if: ${{ runner.os == 'macOS' }}
uses: ./.github/actions/build-mac
with:
production-release: ${{ inputs.production-release }}
release-version: ${{ needs.create-release.outputs.release-version }}
outputs:
linux-artifact-name: ${{ steps.build-linux.outputs.artifact-name }}
windows-artifact-name: ${{ steps.build-windows.outputs.artifact-name }}

publish:
name: Publish
Expand Down

0 comments on commit 8c3b875

Please sign in to comment.