-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows + Linux builds and auto versioning
- Loading branch information
Dextinfire
committed
Aug 25, 2024
1 parent
eac9e10
commit 101db46
Showing
1 changed file
with
20 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,12 @@ on: | |
push: | ||
tags: | ||
- 'v*.*.*' # Triggers on version tags | ||
branches: | ||
- '**' # Triggers on all branches | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
runs-on: ubuntu-latest # Use a single runner | ||
|
||
steps: | ||
- name: Checkout code | ||
|
@@ -18,21 +20,27 @@ jobs: | |
with: | ||
dotnet-version: '8.0' | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
- name: Git Version | ||
id: version | ||
uses: codacy/[email protected] | ||
|
||
- name: Build | ||
run: dotnet build --configuration Release --no-restore | ||
|
||
- name: Publish | ||
run: dotnet publish --configuration Release --no-build --output ./output | ||
|
||
- name: Zip Files | ||
run: Compress-Archive -Path ./output/* mgsscripttools.zip | ||
run: | | ||
dotnet publish --configuration Release --runtime win-x64 --no-self-contained --output publish/magesscripttool-windows-amd64 src/MagesScriptTool | ||
dotnet publish --configuration Release --runtime linux-x64 --no-self-contained --output publish/magesscripttool-linux-amd64 src/MagesScriptTool | ||
pushd publish/magesscripttool-windows-amd64 | ||
zip -r ../magesscripttool-windows-amd64.zip * | ||
popd | ||
pushd publish/magesscripttool-linux-amd64 | ||
zip -r ../magesscripttool-linux-amd64.zip * | ||
popd | ||
- name: Create GitHub Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: mgsscripttools.zip | ||
files: | | ||
publish/magesscripttool-linux-amd64.zip | ||
publish/magesscripttool-windows-amd64.zip | ||
tag_name: ${{ steps.version.outputs.version }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |