Files
2020-08-02 00:47:50 +02:00

88 lines
2.7 KiB
YAML

name: Build
on: [push]
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
# Build Artifact
- uses: actions/checkout@master
- name: configure
run: cmake . -DCMAKE_BUILD_TYPE=RELEASE
- if: startsWith(matrix.os,'ubuntu') || startsWith(matrix.os,'macOS')
name: make
run: make
- if: startsWith(matrix.os,'windows')
name: make
run: cmake --build . --target ALL_BUILD --config Release -- /nologo /verbosity:minimal /maxcpucount
# Rename Artifact
- if: startsWith(matrix.os,'ubuntu')
name: Rename binary
run: mv bin/PassCoder2 bin/PassCoder2-linux-x64
- if: startsWith(matrix.os, 'macOS')
name: Rename binary
run: mv bin/PassCoder2 bin/PassCoder2-macos-x64
- if: startsWith(matrix.os, 'windows')
name: Rename binary
run: mv bin/Release/PassCoder2.exe bin/Release/PassCoder2-windows-x64.exe
# Uploading Artifact
- if: startsWith(matrix.os,'ubuntu')
name: Upload binary
uses: actions/upload-artifact@v2
with:
name: PassCoder2-linux-x64
path: bin/PassCoder2-linux-x64
- if: startsWith(matrix.os, 'macOS')
name: Upload binary
uses: actions/upload-artifact@v2
with:
name: PassCoder2-macos-x64
path: bin/PassCoder2-macos-x64
- if: startsWith(matrix.os, 'windows')
name: Upload binary
uses: actions/upload-artifact@v2
with:
name: PassCoder2-windows-x64
path: bin/Release/PassCoder2-windows-x64.exe
release-upload:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
name: Upload artifact to Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/download-artifact@master
name: Download Artifact Windows
with:
name: PassCoder2-windows-x64
path: PassCoder2-windows-x64
- uses: actions/download-artifact@master
name: Download Artifact Linux
with:
name: PassCoder2-linux-x64
path: PassCoder2-linux-x64
- uses: actions/download-artifact@master
name: Download Artifact MacOS
with:
name: PassCoder2-macos-x64
path: PassCoder2-macos-x64
- name: Create release
uses: Roang-zero1/github-create-release-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub release
uses: Roang-zero1/github-upload-release-artifacts-action@master
with:
args:
PassCoder2-windows-x64
PassCoder2-linux-x64
PassCoder2-macos-x64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}