Skip to content

Update build-artifact.yml #42

Update build-artifact.yml

Update build-artifact.yml #42

Workflow file for this run

name: Build artifact.
on:
push:
tags:
- "v*"
branches: '*'
pull_request:
branches: '*'
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
# get version from pushed tag
- name: Extract version
if: startsWith(github.ref, 'refs/tags/v')
id: version
run: |
echo "TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_OUTPUT}
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> ${GITHUB_OUTPUT}
# Install the .NET Core workload
- name: Install .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
# Create the app package by building and packaging the Windows Application Packaging project
- name: Build the app
run: |
cd AmpHelper.CLI
dotnet publish -c Release -o ../publish/AmpHelper.CLI -r win-x64 -p:PublishSingleFile=true --self-contained=false
dotnet publish -c Release -o ../publish/AmpHelper.CLI.Self-Contained -r win-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained=true
- name: Upload framework dependent build
uses: actions/[email protected]
with:
name: "AmpHelper"
path: publish/AmpHelper.CLI/AmpHelper.exe
retention-days: 90
- name: Upload self-contained build
uses: actions/[email protected]
with:
name: "AmpHelper"
path: publish/AmpHelper.CLI.Self-Contained/AmpHelper.exe
retention-days: 90
# if we had a tag, we should make a release
- name: Upload release artifacts
if: startsWith(github.ref, 'refs/tags/v')
id: upload_file_release
uses: softprops/[email protected]
with:
tag_name: ${{ github.event.inputs.version }}
draft: false
generate_release_notes: true
files: |
./publish/AmpHelper.CLI.Self-Contained/AmpHelper.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}