Skip to content

create-release

create-release #81

Workflow file for this run

name: create-release
on:
workflow_dispatch:
env:
DOTNET_VERSION: '7.x'
OUTPUT_ARTIFACT_FILENAME: 'SteamAccountSwitcher_Win-x86.zip'
TAG_NAME: ${{ github.run_id }}-${{ github.run_number }}
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup dotnet ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: 🙉 Installing dependencies
run: dotnet restore
- name: 🛠️ Build
run: |
cd "SteamAccountManager.AvaloniaUI"
dotnet build --configuration Release
dotnet publish --self-contained -c Release -f "net7.0-windows10.0.17763.0" -o ../output -r win-x86 -p:PublishReadyToRun=true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None -p:DebugSymbols=false
- name: Create Artifacts
run: |
7z a -tzip ${{ env.OUTPUT_ARTIFACT_FILENAME }} output/*
- name: 🔮 Upload Build Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.OUTPUT_ARTIFACT_FILENAME }}
path: ${{ env.OUTPUT_ARTIFACT_FILENAME }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
release_name: SteamAccountSwitcher
draft: true
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 }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ${{ env.OUTPUT_ARTIFACT_FILENAME }}
asset_name: ${{ env.OUTPUT_ARTIFACT_FILENAME }}
asset_content_type: application/zip