ci(macos+linux): tar artifact and add executable test #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: macOS X86-64 Build | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: macos-latest | |
permissions: | |
actions: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: brew install cmake allegro fluid-synth mad enet dylibbundler | |
- name: Build | |
run: ./scripts/build-macos.sh | |
- name: Bundle libs | |
run: ./scripts/bundle-libs-macos.sh | |
- name: Test executable | |
run: | | |
brew uninstall allegro fluid-synth mad enet | |
./dist/dunedynasty | grep "data directory" | |
- name: Tar files | |
run: tar -cvf dist.tar dist | |
- name: Delete Old Artifacts | |
uses: actions/github-script@v6 | |
id: artifact | |
with: | |
script: | | |
const res = await github.rest.actions.listArtifactsForRepo({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
}) | |
res.data.artifacts | |
.filter(({ name }) => name === 'macos-x86-64-build') | |
.forEach(({ id }) => { | |
github.rest.actions.deleteArtifact({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
artifact_id: id, | |
}) | |
}) | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: macos-x86-64-build | |
path: dist.tar |