Skip to content

Merge pull request #90 from BaseMC/develop #15

Merge pull request #90 from BaseMC/develop

Merge pull request #90 from BaseMC/develop #15

Workflow file for this run

name: Master CI
on:
workflow_dispatch:
push:
branches: [ master ]
jobs:
build_release:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_draft.outputs.upload_url }}
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Build - Dotnet Build Release
run: dotnet build --configuration Release
working-directory: src
#Build and prepare build tool
- name: Publish build tool - ADB
working-directory: src/ADB
run: dotnet publish -c Release
- name: Self test build tool - ADB
working-directory: src/ADB/bin/Release/net8.0/publish
run: ./ADB --version
- name: Pack ADB - ADB
working-directory: src/ADB/bin/Release/net8.0/publish
run: zip -r ADB.zip . -x \*.pdb
- name: Upload ADB - Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ADB
path: src/ADB/bin/Release/net8.0/publish/ADB.zip
- name: Release - Create Draft for Release
id: create_draft
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_variants:
name: Variant
runs-on: ubuntu-latest
needs: [build_release]
strategy:
matrix:
os: [win-x64, linux-x64, osx-x64, linux-arm64]
configuration: [Release]
project: [Aves]
steps:
- uses: actions/checkout@v4
- name: Download ADB - Download Artifact
uses: actions/download-artifact@v4
with:
name: ADB
path: temp_artf/ADB
- name: Unzip ADB
run: unzip temp_artf/ADB/ADB.zip -d build
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Publish ${{ matrix.os }} ${{ matrix.configuration }} - dotnet publish
working-directory: src/${{ matrix.project }}
run: dotnet publish -c ${{ matrix.configuration }} -r ${{ matrix.os }} /p:PublishSingleFile=true
- name: Download dependencies of ${{ matrix.os }} - ADB
working-directory: build
run: ./ADB -c config.json --rid ${{ matrix.os }} --bc ${{ matrix.configuration }}
timeout-minutes: 3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#Ignore pdb files
- name: Pack ${{ matrix.os }} - Zip
working-directory: src/${{ matrix.project }}/bin/${{ matrix.configuration }}/net8.0/${{ matrix.os }}/publish/
run: zip -r ${{ matrix.project }}.zip . -x \*.pdb
- name: Upload ${{ matrix.project }}-${{ matrix.os }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-${{ matrix.os }}
path: ./src/${{ matrix.project }}/bin/${{ matrix.configuration }}/net8.0/${{ matrix.os }}/publish/${{ matrix.project }}.zip
- name: Release ${{ matrix.os }} - Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.build_release.outputs.upload_url }}
asset_path: ./src/${{ matrix.project }}/bin/${{ matrix.configuration }}/net8.0/${{ matrix.os }}/publish/${{ matrix.project }}.zip
asset_name: ${{ matrix.project }}-${{ matrix.os }}.zip
asset_content_type: application/zip