From bec3ff9e4fbbc2cae1ec7c490d7482ae6e296130 Mon Sep 17 00:00:00 2001 From: tuxuser <462620+tuxuser@users.noreply.github.com> Date: Fri, 3 Jan 2025 22:53:01 +0100 Subject: [PATCH] ci: test --- .github/workflows/build.yml | 5 +++++ .github/workflows/release.yml | 34 ++++++++++++++++++++++------------ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6af87c7..599bda4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,3 +15,8 @@ jobs: dotnet-version: 8.0.x - name: Build run: dotnet build src\DurangoInteropDotnet.csproj -property:Configuration=Release + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: win-release-artifacts + path: src/bin/Release/net8.0-windows/** diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a828926..2b88555 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,35 +1,45 @@ name: Create Release on: - push: - tags: - - "v*" + workflow_run: + workflows: ["Build"] + types: [completed] permissions: contents: write + actions: read jobs: release: runs-on: windows-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup .NET SDK 8.0 - uses: actions/setup-dotnet@v2 + - name: Get Run Id + id: get-run-id + shell: bash + env: + WORKFLOW_NAME: Build + run: | + RUN_ID=`gh run --repo ${{ github.repository }} list --workflow ${WORKFLOW_NAME} --json databaseId --jq .[0].databaseId` + echo "Workflow run id: ${RUN_ID}" + echo "run-id=${RUN_ID} >> $GITHUB_OUTPUT" + + - uses: actions/download-artifact@v4 with: - dotnet-version: 8.0.x - - name: Build - run: dotnet build src\DurangoInteropDotnet.csproj -property:Configuration=Release + run-id: ${{ steps.get-run-id.outputs.run-id }} + + - name: List files + run: ls -R . + - name: Package shell: bash run: | - cd src/bin/Release/net8.0-windows 7z a -tzip "DurangoInterop_${{github.ref_name}}.zip" "*" - name: Create Release uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/v') with: token: ${{ secrets.GITHUB_TOKEN }} - files: "src/bin/Release/net8.0-windows/DurangoInterop_${{github.ref_name}}.zip" + files: "DurangoInterop_${{github.ref_name}}.zip" make_latest: true generate_release_notes: true fail_on_unmatched_files: true