Skip to content

Commit

Permalink
CI: build petals
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Oct 18, 2023
1 parent e2a23d4 commit 66102ba
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions .github/workflows/on-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,28 @@ name: On Tag
on:
push:
tags: ["v*"]
pull_request: # TODO: remove?
jobs:
build-sidecar-macos-intel:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with: {python-version: 3.11}
- run: ./scripts/build_petals_sidecar.sh x86_64 x86_64
- uses: actions/upload-artifact@v3
with: {path: dist/*}
build-sidecar-macos-arm:
runs-on: macos-latest-xlarge
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with: {python-version: 3.11}
- run: ./scripts/build_petals_sidecar.sh arm64 aarch64
- uses: actions/upload-artifact@v3
with: {path: dist/*}
publish-tauri:
needs: [build-macos-intel, build-macos-arm]
permissions: write-all
strategy:
fail-fast: false
Expand All @@ -23,11 +43,22 @@ jobs:
node-version: "lts/*"
cache: npm
- run: npm install
- uses: actions/download-artifact@v3
with: {path: dist}
- name: metadata
id: metadata
run: |
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
echo "debug:"
ls dist/*
echo "debug: fix sidecar permissions"
chmod +x dist/*
if test ${{ github.event_name == 'push' }} = true; then
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
else
echo "tag=test" >> $GITHUB_OUTPUT
echo "version=0.0.0-test" >> $GITHUB_OUTPUT
fi
- name: Update with latest main branch
run: |
git config --local user.email "$(git log --format='%ae' HEAD^!)"
Expand Down Expand Up @@ -67,12 +98,14 @@ jobs:
updaterJsonKeepUniversal: true
args: '--target universal-apple-darwin'
- name: Commit & Push
if: github.event_name == 'push'
run: |
# Commit package.json, tauri.conf.json, Cargo.toml
git add .
git commit -m "${{ steps.metadata.outputs.tag }}"
git push origin HEAD:main
push-docker-image:
if: github.event_name == 'push'
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: enabled
Expand Down

0 comments on commit 66102ba

Please sign in to comment.