From 8e935d677d26664fd6bb21b1a0ff2cd99a15501b Mon Sep 17 00:00:00 2001 From: Peter Galonza Date: Mon, 24 Jun 2024 10:07:04 +0300 Subject: [PATCH] feature: add build with github actions --- .github/workflows/build-jobs.yaml | 46 +++++++++++++++++++++++++++++++ .github/workflows/build.yml | 14 ++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/build-jobs.yaml create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build-jobs.yaml b/.github/workflows/build-jobs.yaml new file mode 100644 index 00000000..c478a0b8 --- /dev/null +++ b/.github/workflows/build-jobs.yaml @@ -0,0 +1,46 @@ +name: Build jobs + +on: + workflow_call: + +jobs: + main: + strategy: + fail-fast: false + matrix: + job_name: ['linux', 'windows', 'macos'] + include: + - job_name: linux + os: ubuntu-latest + shell: bash {0} + - job_name: windows + os: windows-latest + shell: powershell {0} + - job_name: macos + os: macos-latest + shell: bash {0} + defaults: + run: + shell: ${{ matrix.shell }} + + name: hactoolnet-${{ matrix.job_name }} + runs-on: ${{ matrix.os }} + # container: docker pull mcr.microsoft.com/dotnet/sdk:8.0 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build hactoolnet + if: matrix.os == 'windows-latest' + run: | + .\build.ps1 appveyorbuild --noreflection + - name: Build hactoolnet + if: matrix.os != 'windows-latest' + run: | + chmod +x ./build.sh + ./build.sh appveyorbuild --noreflection + - uses: actions/upload-artifact@v4 + with: + retention-days: 1 + compression-level: 0 + name: hactoolnet-${{ matrix.job_name }} + path: ./artifacts/hactoolnet* diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..29bdc2ab --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,14 @@ +name: Build hactoolnet + +on: + push: + branches: + - master + - feature-integration + paths-ignore: + - 'Dockerfile' + - '.github/workflows/image.yml' + +jobs: + build-workflow: + uses: ./.github/workflows/build-jobs.yaml