Skip to content

Commit

Permalink
simplify workflow, split OSes
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-wes committed Jun 2, 2024
1 parent 72f1e46 commit f10d758
Showing 1 changed file with 16 additions and 42 deletions.
58 changes: 16 additions & 42 deletions .github/workflows/compile-and-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
LIBNAME: simplex~

jobs:
build-linux:
build_linux:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
name: ${{env.LIBNAME}}-${{ matrix.os }}-${{ matrix.arch }}-pd${{ matrix.floatsize }}
path: build/${{env.LIBNAME}}

build-macos:
build_macos:
runs-on: macos-latest
strategy:
matrix:
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
name: ${{env.LIBNAME}}-${{ matrix.os }}-${{ matrix.arch }}-pd${{ matrix.floatsize }}
path: build/${{env.LIBNAME}}

build-windows:
build_windows:
runs-on: windows-latest
strategy:
matrix:
Expand Down Expand Up @@ -124,69 +124,43 @@ jobs:
name: ${{env.LIBNAME}}-${{ matrix.os }}-${{ matrix.arch }}-pd${{ matrix.floatsize }}
path: build/${{env.LIBNAME}}


download-artifacts:
runs-on: ubuntu-latest
needs: [ build-linux, build-macos, build-windows ]
strategy:
matrix:
os: [linux, darwin, windows]
arch: [amd64, arm64]
floatsize: [32, 64]
exclude:
- { os: windows, arch: arm64 }
- { os: darwin, arch: arm64 }
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ${{env.LIBNAME}}-${{ matrix.os }}-${{ matrix.arch }}-pd${{ matrix.floatsize }}
path: artifacts/${{ matrix.os }}

package-release:
needs: download-artifacts
package_release:
runs-on: ubuntu-latest
needs: [build_linux, build_macos, build_windows]
permissions:
contents: write
actions: read
steps:
- name: Setup directories
run: |
mkdir -p ${{env.LIBNAME}}
mkdir -p artifacts/linux
mkdir -p artifacts/darwin
mkdir -p artifacts/windows
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
path: artifacts

- name: Merge Artifacts
run: |
cp -rn artifacts/*/* ${{env.LIBNAME}}/
- name: Rezip
- name: Rezip Artifacts
run: |
SHORT=${GITHUB_REF:11} # Removes 'refs/tags/' prefix
SLUG=${SHORT//\//_} # Replaces '/' with '_'
zip -r ${{env.LIBNAME}}-${SLUG}.zip ${{env.LIBNAME}}
mkdir -p packages
for os in linux darwin windows; do
mkdir -p artifacts/$os
zip -r packages/${{env.LIBNAME}}-${SLUG}-${os}.zip artifacts/${{env.LIBNAME}}-$os-*
done
- name: Upload release content as Artifact
uses: actions/upload-artifact@v4
with:
name: ${{env.LIBNAME}}
path: ${{env.LIBNAME}}
name: ${{env.LIBNAME}}-packages
path: packages

- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: simplex*.zip
files: packages/${{env.LIBNAME}}*.zip

upload_to_deken:
runs-on: ubuntu-latest
needs: [package-release]
needs: [package_release]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
Expand Down

0 comments on commit f10d758

Please sign in to comment.