From ede40973919344d0c1ffb7ad5e26426625d7dfa8 Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 19:46:18 +0000 Subject: [PATCH 01/27] add setup-rust step --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf6a83b..77f1bf8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,6 +34,8 @@ jobs: - uses: actions/setup-dotnet@v3 with: dotnet-version: '7' + - name: Setup Rust/Cargo + uses: moonrepo/setup-rust@v1 - name: Install dependencies run: dotnet restore - name: Build From 646ea48112e03be1e6fff44a34255ab7d766d2aa Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 19:47:33 +0000 Subject: [PATCH 02/27] update actions/checkout from v2 to v4 --- .github/workflows/publish.yml | 2 +- .github/workflows/release.yml | 6 +++--- .github/workflows/test.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 38aefe1..812261a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,7 +8,7 @@ jobs: nuget: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-dotnet@v3 with: dotnet-version: '7' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e141a4d..6423ce6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ jobs: validate-tag: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - id: tag uses: dawidd6/action-get-tag@v1 - id: regex-match @@ -43,7 +43,7 @@ jobs: target: osx-x64 os: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-dotnet@v3 with: dotnet-version: '7' @@ -81,7 +81,7 @@ jobs: name: Create .nupkg runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-dotnet@v3 with: dotnet-version: '7' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 77f1bf8..78124e4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ jobs: name: Code style check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-dotnet@v3 with: dotnet-version: '7' @@ -30,7 +30,7 @@ jobs: env: OS: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-dotnet@v3 with: dotnet-version: '7' From 31d0053b4897e550a5332b5212448c34a2fc198b Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 19:48:12 +0000 Subject: [PATCH 03/27] update actions/setup-dotnet from v3 to v4 --- .github/workflows/publish.yml | 2 +- .github/workflows/release.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 812261a..e3ff8fd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v3 + - uses: actions/setup-dotnet@v4 with: dotnet-version: '7' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6423ce6..7f953d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,7 +44,7 @@ jobs: os: macos-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v3 + - uses: actions/setup-dotnet@v4 with: dotnet-version: '7' - id: tag @@ -82,7 +82,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v3 + - uses: actions/setup-dotnet@v4 with: dotnet-version: '7' - id: tag diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 78124e4..9ecae3c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v3 + - uses: actions/setup-dotnet@v4 with: dotnet-version: '7' - uses: actions/setup-python@v2 @@ -31,7 +31,7 @@ jobs: OS: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v3 + - uses: actions/setup-dotnet@v4 with: dotnet-version: '7' - name: Setup Rust/Cargo From d40bcf74e6989452b89af496f617f26225cb27f2 Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 20:31:17 +0000 Subject: [PATCH 04/27] reduce complexity of pure SemVer regex https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7f953d4..da63e5b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: uses: actions-ecosystem/action-regex-match@v2 with: text: ${{ steps.tag.outputs.tag }} - regex: '^([1-9][0-9]*|[0-9])\.([1-9][0-9]*|[0-9])\.([1-9][0-9]*|[0-9])$' + regex: '^([1-9][0-9]*|0)\.([1-9][0-9]*|0)\.([1-9][0-9]*|0)$' - id: fail-fast if: ${{ steps.regex-match.outputs.match == '' }} uses: actions/github-script@v3 From 5b4dccd92e9da6e31bcfadc02c47534f4c414b7b Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 20:32:01 +0000 Subject: [PATCH 05/27] remove 'get tag' step from jobs that depend on `validate-tag` --- .github/workflows/release.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index da63e5b..7e3c7b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,8 +47,7 @@ jobs: - uses: actions/setup-dotnet@v4 with: dotnet-version: '7' - - id: tag - uses: dawidd6/action-get-tag@v1 + - name: Install dependencies run: dotnet restore @@ -85,8 +84,7 @@ jobs: - uses: actions/setup-dotnet@v4 with: dotnet-version: '7' - - id: tag - uses: dawidd6/action-get-tag@v1 + - name: Install dependencies run: dotnet restore From 5c4c5b4ac4663123e984e8858aa714472113d935 Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 20:33:47 +0000 Subject: [PATCH 06/27] add `.yml` entry to editorconfig --- .editorconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.editorconfig b/.editorconfig index fd10fe0..72bd5fd 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,6 +8,9 @@ charset = utf-8 indent_style = space indent_size = 4 +[*.yml] +indent_size = 2 + [*.{cs,vb}] # https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/formatting-rules csharp_new_line_before_open_brace = all From bc5ef4b3b7160e8ff06ff45ef8415cc1523808c1 Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 20:35:22 +0000 Subject: [PATCH 07/27] add `tag` step output to `validate-tag` job outputs --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e3c7b2..e79b2dd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,6 +9,8 @@ jobs: # Validate tag with proper regex since the check above is very limited. validate-tag: runs-on: ubuntu-latest + outputs: + tag: ${{ steps.tag.outputs.tag }} steps: - uses: actions/checkout@v4 - id: tag From 83e673cc0e69042d34c24180d3aab97882b142c9 Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 20:36:22 +0000 Subject: [PATCH 08/27] replace references to `steps.tag.outputs.tag` with `needs.validate-tag.outputs.tag` --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e79b2dd..95fa16c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,7 +56,7 @@ jobs: - name: Build shell: bash run: | - release_name="tcli-${{ steps.tag.outputs.tag }}-${{ matrix.target }}" + release_name="tcli-${{ needs.validate-tag.outputs.tag }}-${{ matrix.target }}" dotnet publish ThunderstoreCLI/ThunderstoreCLI.csproj -c Release -r "${{ matrix.target }}" --self-contained true -f net7.0 -o "${release_name}" if [ "${{ matrix.target }}" == "win-x64" ]; then @@ -71,7 +71,7 @@ jobs: uses: softprops/action-gh-release@v1 with: files: "tcli*" - name: "Thunderstore CLI ${{ steps.tag.outputs.tag }}" + name: "Thunderstore CLI ${{ needs.validate-tag.outputs.tag }}" body_path: ${{ github.workspace }}/.github/RELEASE_TEMPLATE.md draft: true prerelease: ${{ startsWith(steps.tag.outputs.tag, '0.') }} @@ -98,7 +98,7 @@ jobs: uses: softprops/action-gh-release@v1 with: files: "tcli*" - name: "Thunderstore CLI ${{ steps.tag.outputs.tag }}" + name: "Thunderstore CLI ${{ needs.validate-tag.outputs.tag }}" body_path: ${{ github.workspace }}/.github/RELEASE_TEMPLATE.md draft: true prerelease: ${{ startsWith(steps.tag.outputs.tag, '0.') }} From 6c8077b03f9f4d21ee7b786c5b43659b5f53f7c6 Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 20:58:44 +0000 Subject: [PATCH 09/27] hoist job names to top, add step names for `release` workflow --- .github/workflows/release.yml | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95fa16c..63a7837 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,12 +8,15 @@ on: jobs: # Validate tag with proper regex since the check above is very limited. validate-tag: + name: Validate tag's semantic version runs-on: ubuntu-latest outputs: tag: ${{ steps.tag.outputs.tag }} steps: - - uses: actions/checkout@v4 - - id: tag + - name: Checkout ref that triggered workflow + uses: actions/checkout@v4 + - name: Ensure triggering ref is a tag + id: tag uses: dawidd6/action-get-tag@v1 - id: regex-match uses: actions-ecosystem/action-regex-match@v2 @@ -27,9 +30,9 @@ jobs: script: core.setFailed('Tag is invalid') platform-binary: + name: Create binary ${{ matrix.target }} needs: validate-tag if: github.event.base_ref == 'refs/heads/master' - name: Create binary ${{ matrix.target }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -45,8 +48,10 @@ jobs: target: osx-x64 os: macos-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v4 + - name: Checkout ref that triggered workflow + uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 with: dotnet-version: '7' @@ -67,7 +72,7 @@ jobs: rm -r ${release_name} - - name: Publish to GitHub + - name: Add build artifacts to draft GitHub release uses: softprops/action-gh-release@v1 with: files: "tcli*" @@ -77,13 +82,15 @@ jobs: prerelease: ${{ startsWith(steps.tag.outputs.tag, '0.') }} nupkg: + name: Create .nupkg needs: validate-tag if: github.event.base_ref == 'refs/heads/master' - name: Create .nupkg runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v4 + - name: Checkout ref that triggered workflow + uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 with: dotnet-version: '7' @@ -94,7 +101,7 @@ jobs: shell: bash run: dotnet pack ThunderstoreCLI/ThunderstoreCLI.csproj -c Release -o "." -p:EnableInstallers=false -p:PublishSelfContained=false -p:PublishSingleFile=false -p:PublishTrimmed=false -p:PublishReadyToRun=false - - name: Publish to GitHub + - name: Add build artifacts to draft GitHub release uses: softprops/action-gh-release@v1 with: files: "tcli*" From cce90fee34d8fbd9abd5f37b124726a19e6205d0 Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 20:59:15 +0000 Subject: [PATCH 10/27] standardise whitespace between job steps for `release` workflow --- .github/workflows/release.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 63a7837..546d0b0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,14 +15,17 @@ jobs: steps: - name: Checkout ref that triggered workflow uses: actions/checkout@v4 + - name: Ensure triggering ref is a tag id: tag uses: dawidd6/action-get-tag@v1 + - id: regex-match uses: actions-ecosystem/action-regex-match@v2 with: text: ${{ steps.tag.outputs.tag }} regex: '^([1-9][0-9]*|0)\.([1-9][0-9]*|0)\.([1-9][0-9]*|0)$' + - id: fail-fast if: ${{ steps.regex-match.outputs.match == '' }} uses: actions/github-script@v3 @@ -50,11 +53,12 @@ jobs: steps: - name: Checkout ref that triggered workflow uses: actions/checkout@v4 + - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: '7' - + - name: Install dependencies run: dotnet restore @@ -89,11 +93,12 @@ jobs: steps: - name: Checkout ref that triggered workflow uses: actions/checkout@v4 + - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: '7' - + - name: Install dependencies run: dotnet restore From b0bc3ba3b98a66c1a72e247f6aee88fbff6779d5 Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 20:59:41 +0000 Subject: [PATCH 11/27] add steps to setup Cargo before running build command --- .github/workflows/release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 546d0b0..5a5a759 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,6 +62,9 @@ jobs: - name: Install dependencies run: dotnet restore + - name: Setup Cargo/Rust + uses: moonrepo/setup-rust@v1 + - name: Build shell: bash run: | @@ -102,6 +105,9 @@ jobs: - name: Install dependencies run: dotnet restore + - name: Setup Cargo/Rust + uses: moonrepo/setup-rust@v1 + - name: Build shell: bash run: dotnet pack ThunderstoreCLI/ThunderstoreCLI.csproj -c Release -o "." -p:EnableInstallers=false -p:PublishSelfContained=false -p:PublishSingleFile=false -p:PublishTrimmed=false -p:PublishReadyToRun=false From 25b059bae1488217bd0a4718a8bd71b7595874cc Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:07:06 +0000 Subject: [PATCH 12/27] add step names for `test` workflow --- .github/workflows/test.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9ecae3c..604269d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,14 +7,17 @@ jobs: name: Code style check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v4 + - name: Checkout ref that triggered workflow + uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 with: dotnet-version: '7' - - uses: actions/setup-python@v2 + - name: Setup Python + uses: actions/setup-python@v2 with: python-version: '3.8' - - name: Install pre-commit + - name: Install pre-commit framework run: curl https://pre-commit.com/install-local.py | python - - name: Install dotnet-format run: dotnet tool install -g dotnet-format @@ -30,11 +33,13 @@ jobs: env: OS: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v4 + - name: Checkout ref that triggered workflow + uses: actions/checkout@v4 + - name: setup .NET + uses: actions/setup-dotnet@v4 with: dotnet-version: '7' - - name: Setup Rust/Cargo + - name: Setup Cargo/Rust uses: moonrepo/setup-rust@v1 - name: Install dependencies run: dotnet restore From 3fbe8df98673ed9a55082dc406d5b5e04d04f2cc Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:14:42 +0000 Subject: [PATCH 13/27] standardise whitespace between job steps for `test` workflow --- .github/workflows/test.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 604269d..211da03 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,18 +9,23 @@ jobs: steps: - name: Checkout ref that triggered workflow uses: actions/checkout@v4 + - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: '7' + - name: Setup Python uses: actions/setup-python@v2 with: python-version: '3.8' + - name: Install pre-commit framework run: curl https://pre-commit.com/install-local.py | python - + - name: Install dotnet-format run: dotnet tool install -g dotnet-format + - name: Run pre-commit run: ~/bin/pre-commit run --show-diff-on-failure --color=always --all-files @@ -35,18 +40,24 @@ jobs: steps: - name: Checkout ref that triggered workflow uses: actions/checkout@v4 + - name: setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: '7' + - name: Setup Cargo/Rust uses: moonrepo/setup-rust@v1 + - name: Install dependencies run: dotnet restore + - name: Build run: dotnet build --configuration Release --no-restore + - name: Run xUnit tests run: dotnet test -p:EnableInstallers=false --collect:"XPlat Code Coverage" + - name: Upload coverage to Codecov uses: codecov/codecov-action@v2 with: From 5c795468071cdcaebdaf1d2bb43bf80b8d60065c Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:19:27 +0000 Subject: [PATCH 14/27] use more appropriate job names in `release` workflow --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5a5a759..57f5ec5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ on: jobs: # Validate tag with proper regex since the check above is very limited. validate-tag: - name: Validate tag's semantic version + name: Validate tag semantic version runs-on: ubuntu-latest outputs: tag: ${{ steps.tag.outputs.tag }} @@ -33,7 +33,7 @@ jobs: script: core.setFailed('Tag is invalid') platform-binary: - name: Create binary ${{ matrix.target }} + name: Build binaries for ${{ matrix.target }} needs: validate-tag if: github.event.base_ref == 'refs/heads/master' runs-on: ${{ matrix.os }} @@ -89,7 +89,7 @@ jobs: prerelease: ${{ startsWith(steps.tag.outputs.tag, '0.') }} nupkg: - name: Create .nupkg + name: Build NuGet Package needs: validate-tag if: github.event.base_ref == 'refs/heads/master' runs-on: ubuntu-latest From a2c0591d5506f4c76d912967879f739a84528163 Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:19:44 +0000 Subject: [PATCH 15/27] add job name and step names to `publish` workflow --- .github/workflows/publish.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e3ff8fd..362f640 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,10 +6,13 @@ on: jobs: nuget: + name: Publish NuGet Package runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v4 + - name: Checkout ref that triggered workflow + uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 with: dotnet-version: '7' From 61cc94e765c1a5a04cebcd9d11e0a434459206ef Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:20:26 +0000 Subject: [PATCH 16/27] standardise whitespace in `publish` workflow --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 362f640..f6eb4b2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,6 +11,7 @@ jobs: steps: - name: Checkout ref that triggered workflow uses: actions/checkout@v4 + - name: Setup .NET uses: actions/setup-dotnet@v4 with: @@ -24,7 +25,6 @@ jobs: file: "tcli.${{ github.ref_name }}.nupkg" target: "tcli.nupkg" - - name: Publish to NuGet shell: bash run: dotnet nuget push tcli.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate From db4fffd8cd4acaea48995057f9ce1bb5961c1c4f Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:32:03 +0000 Subject: [PATCH 17/27] update fetch-gh-release-asset action and remove redundant default argument --- .github/workflows/publish.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f6eb4b2..b545897 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,9 +18,8 @@ jobs: dotnet-version: '7' - name: Fetch Latest .nupkg - uses: dsaltares/fetch-gh-release-asset@0efe227dedb360b09ea0e533795d584b61c461a9 + uses: dsaltares/fetch-gh-release-asset@1.1.1 with: - token: "${{ secrets.GITHUB_TOKEN }}" version: "tags/${{ github.ref_name }}" file: "tcli.${{ github.ref_name }}.nupkg" target: "tcli.nupkg" From 0945b9a090ef69b725e500e40586ed265aa2aba1 Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:37:26 +0000 Subject: [PATCH 18/27] update to codecov v3 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 211da03..a73f6a4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,7 +59,7 @@ jobs: run: dotnet test -p:EnableInstallers=false --collect:"XPlat Code Coverage" - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: directory: ./ThunderstoreCLI.Tests/TestResults/ env_vars: OS From f2e35566432a802c9bdaccb04eb90e314d04d376 Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:39:45 +0000 Subject: [PATCH 19/27] update triggers for the 'test' task --- .github/workflows/test.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a73f6a4..b1149aa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,11 @@ name: Build & Test -on: [push] +on: + # Trigger on pushes to the main branch + push: + branches: [ main ] + # Trigger on any pull request + pull_request: jobs: pre-commit: From 264f219720899675c6b973ba2e6cd27654fc82c7 Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:43:50 +0000 Subject: [PATCH 20/27] replace dawid66/action-get-tag with updated + verified fork devops-actions/action-get-tag --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 57f5ec5..eddaf2f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: - name: Ensure triggering ref is a tag id: tag - uses: dawidd6/action-get-tag@v1 + uses: devops-actions/action-get-tag@v1.0.2 - id: regex-match uses: actions-ecosystem/action-regex-match@v2 From 14b4887a34b34c6fe95e7b08016093eb23befd1d Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:48:59 +0000 Subject: [PATCH 21/27] add 'Build and Test' status badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8cd8eeb..41478b2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # thunderstore-cli +[![Build & Test](/~https://github.com/thunderstore-io/thunderstore-cli/actions/workflows/test.yml/badge.svg)](/~https://github.com/thunderstore-io/thunderstore-cli/actions/workflows/test.yml) [![codecov](https://codecov.io/gh/thunderstore-io/thunderstore-cli/branch/master/graph/badge.svg)](https://codecov.io/gh/thunderstore-io/thunderstore-cli) Thunderstore CLI (just "TCLI" from here on) is a command line tool for building and uploading mod packages to From 3f4e91567b973ed61dda1b92ec3dfdc030196c6e Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:49:11 +0000 Subject: [PATCH 22/27] add NuGet package version badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 41478b2..1fbb6e4 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Build & Test](/~https://github.com/thunderstore-io/thunderstore-cli/actions/workflows/test.yml/badge.svg)](/~https://github.com/thunderstore-io/thunderstore-cli/actions/workflows/test.yml) [![codecov](https://codecov.io/gh/thunderstore-io/thunderstore-cli/branch/master/graph/badge.svg)](https://codecov.io/gh/thunderstore-io/thunderstore-cli) +[![NuGet Package](https://img.shields.io/nuget/v/tcli)](https://www.nuget.org/packages/tcli) Thunderstore CLI (just "TCLI" from here on) is a command line tool for building and uploading mod packages to [Thunderstore](https://thunderstore.io/) mod database, and installing mods via the command line. From 9dda3dcd0140fa511c63d521f848420de754c202 Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:49:21 +0000 Subject: [PATCH 23/27] add NuGet Downloads badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1fbb6e4..4101faa 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Build & Test](/~https://github.com/thunderstore-io/thunderstore-cli/actions/workflows/test.yml/badge.svg)](/~https://github.com/thunderstore-io/thunderstore-cli/actions/workflows/test.yml) [![codecov](https://codecov.io/gh/thunderstore-io/thunderstore-cli/branch/master/graph/badge.svg)](https://codecov.io/gh/thunderstore-io/thunderstore-cli) [![NuGet Package](https://img.shields.io/nuget/v/tcli)](https://www.nuget.org/packages/tcli) +[![downloads](https://img.shields.io/nuget/dt/tcli)](https://www.nuget.org/packages/tcli) Thunderstore CLI (just "TCLI" from here on) is a command line tool for building and uploading mod packages to [Thunderstore](https://thunderstore.io/) mod database, and installing mods via the command line. From 5a503a9b99aa2cabf05ea24afbec7448f89f14a9 Mon Sep 17 00:00:00 2001 From: Lordfirespeed <28568841+Lordfirespeed@users.noreply.github.com> Date: Wed, 6 Dec 2023 05:47:50 +0000 Subject: [PATCH 24/27] update github-script action --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eddaf2f..6afd7cc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: Checkout ref that triggered workflow uses: actions/checkout@v4 - - name: Ensure triggering ref is a tag + - name: Ensure triggering ref is a tag id: tag uses: devops-actions/action-get-tag@v1.0.2 @@ -28,7 +28,7 @@ jobs: - id: fail-fast if: ${{ steps.regex-match.outputs.match == '' }} - uses: actions/github-script@v3 + uses: actions/github-script@v7 with: script: core.setFailed('Tag is invalid') From ed7de60e12bf5c04eac22830b6397499a1f25ebd Mon Sep 17 00:00:00 2001 From: Mythic Date: Wed, 6 Dec 2023 18:53:57 +0200 Subject: [PATCH 25/27] Update test workflow branch name --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b1149aa..a02ea0a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ name: Build & Test on: # Trigger on pushes to the main branch push: - branches: [ main ] + branches: [ master ] # Trigger on any pull request pull_request: From 1aa408421bdbb82afe8d24c61cb2f4beaf9c74c0 Mon Sep 17 00:00:00 2001 From: Mythic Date: Wed, 6 Dec 2023 19:00:59 +0200 Subject: [PATCH 26/27] Run pre-commit --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a02ea0a..06c9fb2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,11 +1,11 @@ name: Build & Test -on: +on: # Trigger on pushes to the main branch push: branches: [ master ] # Trigger on any pull request - pull_request: + pull_request: jobs: pre-commit: @@ -62,7 +62,7 @@ jobs: - name: Run xUnit tests run: dotnet test -p:EnableInstallers=false --collect:"XPlat Code Coverage" - + - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: From c18cd03a60d55fc80bf8e4598fcb7af949e8c42f Mon Sep 17 00:00:00 2001 From: Mythic Date: Wed, 6 Dec 2023 19:12:14 +0200 Subject: [PATCH 27/27] Add codecov token to test workflow --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 06c9fb2..9c234ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -69,3 +69,4 @@ jobs: directory: ./ThunderstoreCLI.Tests/TestResults/ env_vars: OS fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }}