mirror of
https://github.com/Myxelium/Lunaris2.0.git
synced 2026-04-09 06:09:39 +00:00
68 lines
1.8 KiB
YAML
68 lines
1.8 KiB
YAML
name: .NET Core CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0 # required for github-action-get-previous-tag
|
|
|
|
- name: Get previous tag
|
|
id: previoustag
|
|
uses: 'WyriHaximus/github-action-get-previous-tag@v1'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Get next minor version
|
|
id: semver
|
|
uses: 'WyriHaximus/github-action-next-semvers@v1'
|
|
with:
|
|
version: ${{ steps.previoustag.outputs.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 /p:Version=${{ steps.previoustag.outputs.tag }} -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: Create Release
|
|
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
|
|
with:
|
|
tag_name: ${{ steps.semver.outputs.patch }}
|
|
release_name: Release ${{ steps.semver.outputs.patch }}
|
|
draft: false
|
|
prerelease: false
|
|
|
|
- name: Upload Release Asset
|
|
id: upload-release-asset
|
|
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_content_type: application/zip
|