Skip to content

Commit

Permalink
workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
danemadsen committed Jul 27, 2024
1 parent 555a9c8 commit 4a47115
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ jobs:
- name: Upload Build Artifacts
uses: actions/upload-artifact@v3
with:
name: build-linux
name: linux-x86_64
path: lib/
16 changes: 8 additions & 8 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Upload Build Artifacts
uses: actions/upload-artifact@v3
with:
name: build-macos-${{ matrix.arch }}
name: macos-${{ matrix.arch }}
path: lib/

create-universal-dylibs:
Expand All @@ -59,25 +59,25 @@ jobs:
- name: Download x86_64 Build Artifacts
uses: actions/download-artifact@v3
with:
name: build-macos-x86_64
path: build-macos-x86_64
name: macos-x86_64
path: macos-x86_64

- name: Download arm64 Build Artifacts
uses: actions/download-artifact@v3
with:
name: build-macos-arm64
path: build-macos-arm64
name: macos-arm64
path: macos-arm64

- name: Create Universal dylibs
run: |
mkdir -p universal/lib
for dylib in build-macos-x86_64/*.dylib; do
for dylib in macos-x86_64/*.dylib; do
dylib_name=$(basename $dylib)
lipo -create build-macos-x86_64/$dylib_name build-macos-arm64/$dylib_name -output universal/$dylib_name
lipo -create macos-x86_64/$dylib_name macos-arm64/$dylib_name -output universal/$dylib_name
done
- name: Upload Universal dylibs
uses: actions/upload-artifact@v3
with:
name: universal-dylibs
name: macos-universal
path: universal/
97 changes: 97 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Create Release

on:
workflow_run:
workflows:
- "Build Linux"
- "Build MacOS"
types:
- completed

jobs:
create-release:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Get Current Git Commit
id: git_commit
run: echo "::set-output name=hash::$(git rev-parse HEAD)"

- name: Download Linux Build Artifacts
uses: actions/download-artifact@v3
with:
name: linux-x86_64
path: artifacts/linux-x86_64

- name: Download MacOS x86_64 Build Artifacts
uses: actions/download-artifact@v3
with:
name: macos-x86_64
path: artifacts/macos-x86_64

- name: Download MacOS arm64 Build Artifacts
uses: actions/download-artifact@v3
with:
name: macos-arm64
path: artifacts/macos-arm64

- name: Download MacOS Universal Build Artifacts
uses: actions/download-artifact@v3
with:
name: macos-universal
path: artifacts/macos-universal

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.git_commit.outputs.hash }}
release_name: Release ${{ steps.git_commit.outputs.hash }}
draft: false
prerelease: false

- name: Upload Linux Build Artifact to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/linux-x86_64/lib
asset_name: linux-x86_64-lib.zip
asset_content_type: application/zip

- name: Upload MacOS x86_64 Build Artifact to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/macos-x86_64/lib
asset_name: macos-x86_64-lib.zip
asset_content_type: application/zip

- name: Upload MacOS arm64 Build Artifact to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/macos-arm64/lib
asset_name: macos-arm64-lib.zip
asset_content_type: application/zip

- name: Upload MacOS Universal Build Artifact to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/macos-universal/lib
asset_name: macos-universal-lib.zip
asset_content_type: application/zip

0 comments on commit 4a47115

Please sign in to comment.