Skip to content

Upgrading some stuff - setting nullable, upgrading to latest Bambu & … #72

Upgrading some stuff - setting nullable, upgrading to latest Bambu & …

Upgrading some stuff - setting nullable, upgrading to latest Bambu & … #72

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Publish Release
on:
push:
tags:
- v*
workflow_dispatch:
inputs:
draft:
description: 'Draft release?'
required: true
default: 'false'
version:
description: 'Version'
required: false
default: 'v'
jobs:
release:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
attestations: write
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x
- name: Build and Test
run: dotnet test --verbosity normal
- name: Generate Semantic Version
id: generate_semver
if: ${{ inputs.version == 'v' && github.event_name == 'workflow_dispatch' }}
uses: zwaldowski/semver-release-action@v4
with:
github_token: ${{ github.token }}
bump: patch
prefix: v
dry_run: true
- name: Set version
id: set_version
run: |
VERSION_TAG=${{ (inputs.version != 'v' && inputs.version) || steps.generate_semver.outputs.version_tag || github.ref_name }}
VERSION=${VERSION_TAG//v/}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "version_tag=$VERSION_TAG" >> $GITHUB_OUTPUT
# Binaries
- name: Publish Windows
run: dotnet publish -r win-x64 /p:Version=${{ steps.set_version.outputs.version }} -o ./publish/win-x64 ./BambuVideoStream
- name: Publish Linux-x64
run: dotnet publish -r linux-x64 /p:Version=${{ steps.set_version.outputs.version }} -o ./publish/linux-x64 ./BambuVideoStream
- name: Publish Linux-arm64
run: dotnet publish -r linux-arm64 /p:Version=${{ steps.set_version.outputs.version }} -o ./publish/linux-arm64 ./BambuVideoStream
- name: Publish OSX-x64
run: dotnet publish -r osx-x64 /p:Version=${{ steps.set_version.outputs.version }} -o ./publish/osx-x64 ./BambuVideoStream
- name: Publish OSX-ARM
run: dotnet publish -r osx-arm64 /p:Version=${{ steps.set_version.outputs.version }} -o ./publish/osx-arm64 ./BambuVideoStream
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: './publish/**'
- name: Zip Artifacts
run: |
mkdir -p ./release
zip -r ./release/win-x64.zip ./publish/win-x64
tar -czvf ./release/linux-x64.tar.gz ./publish/linux-x64
tar -czvf ./release/linux-arm64.tar.gz ./publish/linux-arm64
tar -czvf ./release/osx-x64.tar.gz ./publish/osx-x64
tar -czvf ./release/osx-arm64.tar.gz ./publish/osx-arm64
- name: Generate ZIP attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: './release/*'
# Release
- name: Create GitHub Release
uses: ncipollo/release-action@v1.14.0
with:
artifacts: ./release/*
token: ${{ github.token }}
tag: ${{ steps.set_version.outputs.version_tag }}
commit: ${{ github.sha }}
generateReleaseNotes: true
draft: ${{ inputs.draft }}
prerelease: ${{ contains(steps.set_version.outputs.version_tag, '-') }}
allowUpdates: true
- name: Write version summary
run: echo "# Published ${{ steps.set_version.outputs.version_tag }}" >> $GITHUB_STEP_SUMMARY
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: binaries
path: ./release
outputs:
version: ${{ steps.set_version.outputs.version }}
version_tag: ${{ steps.set_version.outputs.version_tag }}
velopack:
runs-on: windows-latest
needs: release
permissions:
id-token: write
contents: write
attestations: write
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: binaries
path: ./binaries
- name: Unzip Artifacts
run: |
mkdir -p ./publish/win-x64
Expand-Archive -Path ./binaries/win-x64.zip -DestinationPath ./publish
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x
- name: Create Velopack
run: |
dotnet tool restore
dotnet vpk download github -o "./vpk" --repoUrl "https://github.com/${{ github.repository }}"
dotnet vpk pack -o "./vpk" -u "DrEsteban.BambuVideoStream" -v "${{ needs.release.outputs.version }}" -p "./publish/publish/win-x64" --mainExe "BambuVideoStream.exe" --packTitle "Bambu Video Stream Tool" --icon "./BambuVideoStream/icon.ico" --packAuthors "DrEsteban" --skipVeloAppCheck
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: './vpk/**'
- name: Upload Velopack
run: |
dotnet vpk upload github -o ./vpk --repoUrl "https://github.com/${{ github.repository }}" --merge --releaseName "${{ needs.release.outputs.version_tag }}" --tag "${{ needs.release.outputs.version_tag }}" --token "${{ github.token }}"
echo "# Published Velopack ${{ needs.release.outputs.version_tag }}" >> $GITHUB_STEP_SUMMARY