diff --git a/.github/workflows/build-commit.yml b/.github/workflows/build-commit.yml index 6fb54af..28f88f4 100644 --- a/.github/workflows/build-commit.yml +++ b/.github/workflows/build-commit.yml @@ -5,7 +5,11 @@ on: paths: - ".github/workflows/build-commit.yml" - "src/**" + - "tests/**" - "Bundles.sln" + - "Directory.Build.props" + - "Directory.Packages.props" + workflow_dispatch: env: DOTNET_NOLOGO: 1 @@ -14,7 +18,7 @@ env: DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 jobs: - build_commit: + build-commit: name: Build Commit ${{ github.sha }} runs-on: self-hosted if: "!contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[ci-skip]')" @@ -26,4 +30,6 @@ jobs: with: dotnet-version: 8 - name: Build Project - run: dotnet build \ No newline at end of file + run: dotnet build + - name: Run Tests + run: dotnet test \ No newline at end of file diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 613496c..7d47417 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -2,10 +2,18 @@ name: Build PR on: pull_request: + types: + - opened + - synchronize + - reopened + - ready_for_review paths: - ".github/workflows/build-pr.yml" - "src/**" + - "tests/**" - "Bundles.sln" + - "Directory.Build.props" + - "Directory.Packages.props" env: DOTNET_NOLOGO: 1 @@ -14,8 +22,8 @@ env: DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 jobs: - build_pr: - name: Build PR \#${{ github.event.pull_request.number }} + build-pr: + name: "Build PR #${{ github.event.pull_request.number }}" runs-on: self-hosted if: "!contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[ci-skip]')" steps: @@ -26,4 +34,6 @@ jobs: with: dotnet-version: 8 - name: Build Project - run: dotnet build \ No newline at end of file + run: dotnet build + - name: Run Tests + run: dotnet test \ No newline at end of file diff --git a/.github/workflows/images.yml b/.github/workflows/images.yml index 7ea16d9..fa3ef00 100644 --- a/.github/workflows/images.yml +++ b/.github/workflows/images.yml @@ -1,19 +1,20 @@ -name: Regenerate Resource Files +name: Regenerate Image Files on: push: paths: - ".github/workflows/images.yml" - "img/**" - - "tools/generate-assets.sh" + - "tools/generate-images.sh" workflow_dispatch: jobs: regenerate-assets: name: Regenerate Image Files + permissions: write-all runs-on: self-hosted steps: - name: Checkout uses: actions/checkout@v3 - name: Generate Assets - run: tools/generate-assets.sh \ No newline at end of file + run: tools/generate-images.sh \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d9c3ab3..685a375 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,13 +4,6 @@ on: release: types: - "published" - push: - paths: - - ".github/workflows/publish.yml" - - "src/Bundles/Bundles.csproj" - - "tests/Bundles.Tests/Bundles.Tests.csproj" - - "Directory.Build.props" - - "Directory.Packages.props" env: DOTNET_NOLOGO: 1 @@ -22,7 +15,7 @@ jobs: publish_release: name: Publish Release runs-on: "self-hosted" - if: "!contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[ci-skip]') && contains(github.event.release.target_commitish, 'master') && github.event_name == 'release'" + if: "!contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[ci-skip]')" steps: - name: Checkout uses: actions/checkout@v3 @@ -33,7 +26,7 @@ jobs: - name: Publish NuGet packages run: | mkdir build - dotnet pack -c Release -o build + dotnet pack -c Release -o build /p:Version=${{ github.event.release.tag_name }} dotnet nuget push "build/*" -k ${{ secrets.NUGET_ORG_API_KEY }} -s https://api.nuget.org/v3/index.json - name: Upload NuGet packages to GitHub Actions uses: actions/upload-artifact@v3 @@ -48,24 +41,4 @@ jobs: artifacts: "build/*" token: ${{ secrets.GITHUB_TOKEN }} omitNameDuringUpdate: true # We don't want to update the name of the release. - omitBodyDuringUpdate: true # We don't want to update the body of the release. - test_release: - name: Test Release - runs-on: "self-hosted" - if: "!contains(github.event.head_commit.message, '[ci-skip]') && github.ref_name == 'master' && github.event_name == 'push'" - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 8 - - name: Publish NuGet packages - run: | - mkdir build - dotnet pack -c Release -o build - - name: Upload NuGet packages to GitHub Actions - uses: actions/upload-artifact@v3 - with: - name: Bundles Release ${{ github.event.release.name }} NuGet Packages.zip - path: build/* \ No newline at end of file + omitBodyDuringUpdate: true # We don't want to update the body of the release. \ No newline at end of file diff --git a/img/logo.ico b/img/logo.ico index be8e4fb..e288b37 100644 Binary files a/img/logo.ico and b/img/logo.ico differ diff --git a/img/logo.png b/img/logo.png index 8cc978f..f9ac300 100644 Binary files a/img/logo.png and b/img/logo.png differ diff --git a/tools/generate-assets.sh b/tools/generate-images.sh similarity index 61% rename from tools/generate-assets.sh rename to tools/generate-images.sh index 1ac8d23..e7b7b0b 100755 --- a/tools/generate-assets.sh +++ b/tools/generate-images.sh @@ -14,21 +14,13 @@ regenerate() svgo --multipass --quiet "$1" # Convert to PNG - convert -size 1024x1024 -background transparent "$1" "${1%.*}.png" + convert -background none "$1" "${1%.*}.png" # Convert to ICO - # https://stackoverflow.com/a/15104985 - convert -background transparent -colors 256 "$1" \ - \( -clone 0 -resize 16x16 \) \ - \( -clone 0 -resize 32x32 \) \ - \( -clone 0 -resize 48x48 \) \ - \( -clone 0 -resize 64x64 \) \ - \( -clone 0 -resize 128x128 \) \ - \( -clone 0 -resize 256x256 \) \ - -delete 0 "${1%.*}.ico" + convert -background transparent -define "icon:auto-resize=16,24,32,64,128,256" "$1" "${1%.*}.ico" } -# Iterate over each file matching the pattern "*.svg" in the "res" directory +# Iterate over each file matching the pattern "*.svg" in the "img" directory for file in img/*.svg; do # Execute the "regenerate" command on each file regenerate "$file"