66 lines
2.0 KiB
YAML
66 lines
2.0 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
|
|
jobs:
|
|
build:
|
|
name: Build Launcher
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
with:
|
|
ref: ${{ github.head_ref }}
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-dotnet@v3
|
|
with:
|
|
dotnet-version: '8.0.x'
|
|
|
|
- run: dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
|
|
name: Add nuget source
|
|
|
|
- run: dotnet restore CringeLauncher/CringeLauncher.csproj --locked-mode
|
|
name: Restore Project
|
|
|
|
- name: Git Version
|
|
id: version
|
|
uses: codacy/git-version@2.7.1
|
|
|
|
- run: dotnet publish -c Release -o ./pub CringeLauncher/CringeLauncher.csproj --no-restore -p:Version="${{ steps.version.outputs.version }}" -r win-x64 --no-self-contained
|
|
id: publish
|
|
name: Build Project
|
|
|
|
- run: rm ./pub/CringeLauncher.deps.json
|
|
|
|
- run: zip -qq -r ../pub.zip ./
|
|
working-directory: ./pub
|
|
name: Zip Results
|
|
|
|
- name: Create Draft Release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ steps.version.outputs.version }}
|
|
release_name: Launcher Release
|
|
draft: true
|
|
prerelease: false
|
|
|
|
- uses: actions/upload-release-asset@v1.0.1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./pub.zip
|
|
asset_name: CringeLauncher.zip
|
|
asset_content_type: application/zip
|
|
|
|
- uses: eregon/publish-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
release_id: ${{ steps.create_release.outputs.id }}
|