mirror of
https://github.com/Myxelium/Lunaris2.0.git
synced 2026-04-09 06:09:39 +00:00
Update dotnet.yml
This commit is contained in:
80
.github/workflows/dotnet.yml
vendored
80
.github/workflows/dotnet.yml
vendored
@@ -1,36 +1,49 @@
|
||||
name: .NET Core CI
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
target: [x86_64-pc-windows-gnu, x86_64-unknown-linux-gnu]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- name: Install Windows target
|
||||
run: rustup target add x86_64-pc-windows-gnu
|
||||
|
||||
- name: Install MinGW-w64
|
||||
run: sudo apt-get update && sudo apt-get install -y mingw-w64
|
||||
|
||||
- name: Build
|
||||
run: cargo build --release --target ${{ matrix.target }}
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{ matrix.target }}-binary
|
||||
path: target/${{ matrix.target }}/release/
|
||||
|
||||
release:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0 # required for github-action-get-previous-tag
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore ./Bot/Lunaris2.csproj
|
||||
|
||||
- name: Build
|
||||
run: dotnet build ./Bot/Lunaris2.csproj --no-restore -c Release -o ./out
|
||||
|
||||
- name: Publish
|
||||
run: dotnet publish ./Bot/Lunaris2.csproj --configuration Release --output ./out
|
||||
|
||||
- name: Zip the build
|
||||
run: 7z a -tzip ./out/Lunaris.zip ./out/*
|
||||
|
||||
- name: Get previous tag
|
||||
id: previoustag
|
||||
@@ -48,20 +61,29 @@ jobs:
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ steps.semver.outputs.patch }}
|
||||
release_name: Release ${{ steps.semver.outputs.patch }}
|
||||
tag_name: ${{ steps.semver.outputs.next_minor }}
|
||||
release_name: Release ${{ steps.semver.outputs.next_minor }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
- name: Upload Release Asset
|
||||
id: upload-release-asset
|
||||
- name: Upload Release Asset (Windows)
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./out/Lunaris.zip
|
||||
asset_name: Lunaris.zip
|
||||
asset_path: target/x86_64-pc-windows-gnu/release/
|
||||
asset_name: windows-binary.zip
|
||||
asset_content_type: application/zip
|
||||
|
||||
- name: Upload Release Asset (Linux)
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: target/x86_64-unknown-linux-gnu/release/
|
||||
asset_name: linux-binary.tar.gz
|
||||
asset_content_type: application/gzip
|
||||
|
||||
Reference in New Issue
Block a user