Windows + Linux builds and auto versioning #6
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: Build and Release | |
on: | |
push: | |
tags: | |
- 'v*.*.*' # Triggers on version tags | |
branches: | |
- '**' # Triggers on all branches | |
jobs: | |
build: | |
runs-on: ubuntu-latest # Use a single runner | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8.0' | |
- name: Git Version | |
uses: codacy/[email protected] | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build for Windows | |
run: dotnet publish --configuration Release --runtime win-x64 --self-contained --output ./output/windows | |
- name: Build for Linux | |
run: dotnet publish --configuration Release --runtime linux-x64 --self-contained --output ./output/linux | |
- name: Zip Windows Files | |
run: zip -r magesscripttool-windows-amd64.zip ./output/windows/* | |
- name: Zip Linux Files | |
run: zip -r magesscripttool-linux-amd64.zip ./output/linux/* | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
magesscripttool-linux-amd64.zip | |
magesscripttool-windows-amd64.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |