Skip to content

Bump System.CommandLine from 2.0.2 to 2.0.3 #304

Bump System.CommandLine from 2.0.2 to 2.0.3

Bump System.CommandLine from 2.0.2 to 2.0.3 #304

Workflow file for this run

name: release
on:
pull_request:
branches:
- main
paths:
- "src/**"
- "**.props"
- "global.json"
- ".github/workflows/release.yml"
push:
branches:
- main
paths:
- "src/**"
- "**.props"
- "global.json"
- ".github/workflows/release.yml"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
rid: win-x64
archive: zip
- os: ubuntu-latest
rid: linux-x64
archive: tar.gz
- os: macos-15-intel
rid: osx-x64
archive: tar.gz
env:
PUBLISH_DIR: publish/${{ matrix.rid }}
PACKAGE_PATH: video-converter-${{ matrix.rid }}.${{ matrix.archive }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup .NET
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
with:
global-json-file: ./global.json
- name: Restore dependencies
run: dotnet restore
- name: Publish
run: |
dotnet publish src/VideoConverter -c Release -r ${{ matrix.rid }} -o ${{ env.PUBLISH_DIR }}
dotnet publish src/FFmpegDownloader -c Release -r ${{ matrix.rid }} -o ${{ env.PUBLISH_DIR }}
- name: Package
if: matrix.os == 'windows-latest'
shell: pwsh
run: Compress-Archive -Path "${{ env.PUBLISH_DIR }}\*" -DestinationPath ${{ env.PACKAGE_PATH }} -Force
- name: Package
if: matrix.os != 'windows-latest'
shell: bash
run: tar -czvf ${{ env.PACKAGE_PATH }} -C ${{ env.PUBLISH_DIR }} .
- name: Upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ matrix.os }}
path: ${{ env.PACKAGE_PATH }}
overwrite: true
retention-days: 1
if-no-files-found: error
release:
runs-on: ubuntu-latest
environment: release
permissions:
contents: write
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: build
env:
TAG: v1.0.0
TITLE: Video Converter
NOTES: Download latest version
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Download artifacts
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
path: ./packages
merge-multiple: true
- name: Create release
shell: bash
run: |
gh release delete "$TAG" --yes --cleanup-tag || true
gh release create "$TAG" --latest --title "$TITLE" --notes "$NOTES"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload packages
shell: bash
run: |
for f in ./packages/*; do
gh release upload "$TAG" "$f" --clobber
done
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}