Skip to content

Commit

Permalink
Issue #12: CI: add macos, add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nyetwurk committed Oct 28, 2024
1 parent b9301e4 commit 8efeff9
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 41 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/debian-build.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/unix-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Unix Build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [ published ]

env:
artifacts: |
me7sum
ME7Check_linux
README.md
jobs:
build:
strategy:
matrix:
os: [ 'ubuntu', 'macos']
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
- name: make
run: make
- name: make test
run: make test
- uses: rlespinasse/github-slug-action@v4
if: ${{ github.event_name != 'release' }}
with:
short-length: 6
- uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'release' }}
with:
name: me7sum-${{ env.GITHUB_SHA_SHORT }}-${{ matrix.os }}
path: ${{ env.artifacts }}
- name: Upload ${{ matrix.os }} artifact to release
if: github.event_name == 'release' && github.event.action == 'published'
run: |
ARTIFACTS="${artifacts//$'\n'/ }"
echo "Zipping ${ARTIFACTS}"
zip -qr me7sum-${{ github.ref_name }}-${{ matrix.os }}.zip ${ARTIFACTS}
gh release upload --clobber ${{ github.ref_name }} me7sum-${{ github.ref_name }}-${{ matrix.os }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 16 additions & 6 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [ published ]

env:
artifacts: >
me7sum.exe
ME7Check.exe
README.md
jobs:
build:

runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- uses: TheMrMilchmann/setup-msvc-dev@v3
Expand All @@ -26,7 +32,11 @@ jobs:
if: ${{ github.event_name != 'release' }}
with:
name: me7sum-${{ env.GITHUB_SHA_SHORT }}-win
path: |
me7sum.exe
ME7Check.exe
README.md
path: ${{ env.artifacts }}
- name: Upload windows artifact to release
if: github.event_name == 'release' && github.event.action == 'published'
run: |
7z a -tzip me7sum-${{ github.ref_name }}-win.zip ${{ env.artifacts }}
gh release upload --clobber ${{ github.ref_name }} me7sum-${{ github.ref_name }}-win.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 8efeff9

Please sign in to comment.