From 366aa6a601184056ece5613f7b24fed7f176d760 Mon Sep 17 00:00:00 2001 From: Mirko Da Corte Date: Mon, 27 Feb 2023 19:01:28 +0100 Subject: [PATCH] review github action --- ...ish-app-release.yml => publish-stable.yml} | 35 +++++++++---------- EthernaVideoImporter.sln | 2 +- 2 files changed, 18 insertions(+), 19 deletions(-) rename .github/workflows/{publish-app-release.yml => publish-stable.yml} (67%) diff --git a/.github/workflows/publish-app-release.yml b/.github/workflows/publish-stable.yml similarity index 67% rename from .github/workflows/publish-app-release.yml rename to .github/workflows/publish-stable.yml index 953d1ce..85271a6 100644 --- a/.github/workflows/publish-app-release.yml +++ b/.github/workflows/publish-stable.yml @@ -1,12 +1,14 @@ -name: Publish +name: Publish stable release on: - release: - types: [published] + push: + tags: + - 'v*.*.*' jobs: release: name: Release + strategy: matrix: kind: ['linuxselfcontained', 'linux', 'windows'] @@ -18,54 +20,51 @@ jobs: - kind: linux os: ubuntu-latest target: linux-x64 - name: linux-x64 frameworktype: --no-self-contained - kind: windows os: windows-latest target: win-x64 frameworktype: --no-self-contained + runs-on: ${{ matrix.os }} + steps: - name: Checkout - uses: actions/checkout@v1 + uses: actions/checkout@v3 - name: Setup dotnet - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v3 with: dotnet-version: 7.0.x - - name: Build Project Etherna Video Importer + - name: Build EthernaVideoImporter project shell: bash run: | tag=$(git describe --tags --abbrev=0) release_name="etherna-video-importer-$tag-${{ matrix.kind }}" # Build everything - dotnet publish src/EthernaVideoImporter/EthernaVideoImporter.csproj --framework net7.0 --runtime "${{ matrix.target }}" "${{ matrix.frameworktype }}" -c Release -o "$release_name" + dotnet publish src/EthernaVideoImporter/EthernaVideoImporter.csproj --runtime "${{ matrix.target }}" "${{ matrix.frameworktype }}" -c Release -o "$release_name" # Pack files if [ "${{ matrix.target }}" == "win-x64" ]; then - # Pack to zip for Windows 7z a -tzip "${release_name}.zip" "./${release_name}/*" else - tar czvf "${release_name}.tar.gz" "$release_name" + tar czvf "${release_name}.tar.gz" "$release_name" fi - # Delete output directory - rm -r "$release_name" - - name: Build Project Devcon Archive Video Importer + + - name: Build EthernaVideoImporter.Devcon project shell: bash run: | tag=$(git describe --tags --abbrev=0) release_name="devcon-archive-video-importer-$tag-${{ matrix.kind }}" # Build everything - dotnet publish src/DevconArchiveVideoImporter/DevconArchiveVideoImporter.csproj --framework net7.0 --runtime "${{ matrix.target }}" "${{ matrix.frameworktype }}" -c Release -o "$release_name" + dotnet publish src/DevconArchiveVideoImporter/DevconArchiveVideoImporter.csproj --runtime "${{ matrix.target }}" "${{ matrix.frameworktype }}" -c Release -o "$release_name" # Pack files if [ "${{ matrix.target }}" == "win-x64" ]; then - # Pack to zip for Windows 7z a -tzip "${release_name}.zip" "./${release_name}/*" else - tar czvf "${release_name}.tar.gz" "$release_name" + tar czvf "${release_name}.tar.gz" "$release_name" fi - # Delete output directory - rm -r "$release_name" + - name: Publish uses: softprops/action-gh-release@v1 with: diff --git a/EthernaVideoImporter.sln b/EthernaVideoImporter.sln index 832ea93..7da77c7 100644 --- a/EthernaVideoImporter.sln +++ b/EthernaVideoImporter.sln @@ -14,7 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{1E5D1B5B-4926-4F7F-97A9-19DAE5065550}" ProjectSection(SolutionItems) = preProject - .github\workflows\publish-app-release.yml = .github\workflows\publish-app-release.yml + .github\workflows\publish-stable.yml = .github\workflows\publish-stable.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{0A3B4988-7F19-430D-BF6C-31AFD0234C44}"