Skip to content

Commit

Permalink
multiple release files
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-wes committed Jun 4, 2024
1 parent 5fe0578 commit 3e37fb3
Showing 1 changed file with 18 additions and 41 deletions.
59 changes: 18 additions & 41 deletions .github/workflows/compile-and-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ env:
PDINCLUDEDIR: ./pure-data/src
PDLIBDIR: ./build
LIBNAME: simplex~
LIBSLUG: simplex # for github release zip files

jobs:
build_linux:
Expand Down Expand Up @@ -124,9 +125,12 @@ jobs:
name: ${{env.LIBNAME}}-${{ matrix.os }}-${{ matrix.arch }}-pd${{ matrix.floatsize }}
path: build/${{env.LIBNAME}}

package:
package_and_release:
runs-on: ubuntu-latest
needs: [build_linux, build_macos, build_windows]
permissions:
contents: write
actions: read
strategy:
matrix:
os: [windows, darwin, linux]
Expand All @@ -136,60 +140,33 @@ jobs:
with:
path: artifacts

- name: Merge Artifacts
- name: Merge Artifacts for OS
run: |
mkdir -p package
cp -rn artifacts/${{env.LIBNAME}}-${{ matrix.os }}*/* package
mkdir -p ${{env.LIBNAME}}
cp -rn artifacts/${{env.LIBNAME}}-${{ matrix.os }}*/* ${{env.LIBNAME}}
- name: Upload release content as Artifact
- name: Upload Merged Artifact
uses: actions/upload-artifact@v4
with:
name: ${{env.LIBNAME}}-${{ matrix.os }}
path: package

release:
runs-on: ubuntu-latest
needs: [package]
permissions:
contents: write
actions: read
steps:
- name: Download Windows
uses: actions/download-artifact@v4
with:
name: ${{env.LIBNAME}}-windows
path: ${{env.LIBNAME}}-windows

- name: Download Darwin
uses: actions/download-artifact@v4
with:
name: ${{env.LIBNAME}}-darwin
path: ${{env.LIBNAME}}-darwin

- name: Download Linux
uses: actions/download-artifact@v4
with:
name: ${{env.LIBNAME}}-linux
path: ${{env.LIBNAME}}-linux
path: ${{env.LIBNAME}}

- name: Rezip Artifacts
- name: Rezip artifacts for release
if: startsWith(github.ref, 'refs/tags/v')
run: |
SHORT=${GITHUB_REF:11} # Removes 'refs/tags/' prefix
SHORT=${GITHUB_REF:11} # Removes 'refs/tags/v' prefix
SLUG=${SHORT//\//_} # Replaces '/' with '_'
mkdir -p release
for os in linux darwin windows; do
zip -r release/${{env.LIBNAME}}-${SLUG}.zip ${{env.LIBNAME}}-${os}
done
zip -r ${{env.LIBSLUG}}-${{ matrix.os }}.zip ${{env.LIBNAME}}
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
if: startsWith(github.ref, 'refs/tags/v')
with:
files: release/${{env.LIBNAME}}-*.zip
files: ${{env.LIBSLUG}}-${{ matrix.os }}.zip

deken_check_and_upload:
runs-on: ubuntu-latest
needs: [package]
needs: [package_and_release]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -217,7 +194,7 @@ jobs:
DEKEN_USERNAME: ${{ secrets.DEKEN_USERNAME }}
DEKEN_PASSWORD: ${{ secrets.DEKEN_PASSWORD }}
run: | # FIXME: distribute to separate steps?
SHORT=${GITHUB_REF:11} # remove the 'refs/tags/' prefix
SHORT=${GITHUB_REF:11} # remove the 'refs/tags/v' prefix
SLUG=${SHORT//\//_} # replace '/' with '_'
if [[ "${SLUG}" == *"test"* ]]; then
Expand Down

0 comments on commit 3e37fb3

Please sign in to comment.