diff --git a/.github/workflows/BuildPublishPipeline.yml b/.github/workflows/BuildPublishPipeline.yml index 7169e6f..b4c7c78 100644 --- a/.github/workflows/BuildPublishPipeline.yml +++ b/.github/workflows/BuildPublishPipeline.yml @@ -3,9 +3,8 @@ name: Build and publish release on: push: branches: [ main, develop ] - paths-ignore: [ 'README.md' ] pull_request: - branches: [ main ] + branches: [ main, develop ] workflow_dispatch: concurrency: @@ -20,34 +19,27 @@ jobs: steps: - # Install .NET SDK # https://github.com/marketplace/actions/setup-net-core-sdk - name: Setup .NET SDK uses: actions/setup-dotnet@v4 with: dotnet-version: 8.x - - # Checkout code + # https://github.com/marketplace/actions/checkout - name: Checkout code uses: actions/checkout@v4 with: - # Get all history for version calculation fetch-depth: 0 - # Run Nerdbank.GitVersioning # https://github.com/marketplace/actions/nerdbank-gitversioning - name: Run Nerdbank.GitVersioning id: nbgv uses: dotnet/nbgv@master - # Run Unit Tests # https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test - name: Run unit tests run: dotnet test ./UtilitiesTests/UtilitiesTests.csproj - # Build project, build will also create nuget packages, no need for pack - # Set version information attributes # https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-build - name: Build project run: >- @@ -60,7 +52,6 @@ jobs: -property:InformationalVersion=${{ steps.nbgv.outputs.AssemblyInformationalVersion }} -property:PackageVersion=${{ steps.nbgv.outputs.SemVer2 }} - # Publish to NuGet.org Registry # https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-push - name: Publish to NuGet.org if: ${{ github.event_name != 'pull_request' }} @@ -70,7 +61,6 @@ jobs: --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate - # Publish to GitHub NuGet Registry # https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry - name: Publish to GitHub NuGet Registry if: ${{ github.event_name != 'pull_request' }} @@ -80,20 +70,16 @@ jobs: --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate - # Zip the output - name: Zip output if: ${{ github.event_name != 'pull_request' }} run: 7z a -t7z ./Publish/Utilities.7z ./Publish/* - # Create GitHub release - # https://github.com/marketplace/actions/automatic-releases - - name: Create GitHub Release - if: ${{ github.event_name != 'pull_request' }} - uses: marvinpinto/action-automatic-releases@latest + # https://github.com/marketplace/actions/gh-release + - name: Create GitHub release + uses: softprops/action-gh-release@v2 with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - automatic_release_tag: ${{ steps.nbgv.outputs.SemVer2 }} - # Only main branch is not a pre-release + generate_release_notes: true + tag_name: ${{ steps.nbgv.outputs.SemVer2 }} prerelease: ${{ !endsWith(github.ref, 'refs/heads/main') }} files: | LICENSE diff --git a/.github/workflows/CheckForNewLanguageData.yml b/.github/workflows/CheckForNewLanguageData.yml index 0df489c..721f12d 100644 --- a/.github/workflows/CheckForNewLanguageData.yml +++ b/.github/workflows/CheckForNewLanguageData.yml @@ -3,7 +3,6 @@ name: Check for new language data on: workflow_dispatch: schedule: - # Daily 2am - cron: '0 2 * * *' concurrency: @@ -23,26 +22,22 @@ jobs: steps: - # Install .NET SDK # https://github.com/marketplace/actions/setup-net-core-sdk - name: Setup .NET SDK uses: actions/setup-dotnet@v4 with: dotnet-version: 8.x - # Checkout code # https://github.com/marketplace/actions/checkout - name: Checkout code uses: actions/checkout@v4 - # Download data files - name: Download language data files run: | wget -O ./Data/ISO-639-2_utf-8.txt https://www.loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt wget -O ./Data/iso-639-3.tab https://iso639-3.sil.org/sites/iso639-3/files/downloads/iso-639-3.tab wget -O ./Data/language-subtag-registry https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry - # Build T4 templates - name: Build T4 templates run: | dotnet tool install -g dotnet-t4 @@ -60,24 +55,20 @@ jobs: with: commit_message: Update language data and generated files - # Trigger build triggerbuild: name: Trigger build runs-on: ubuntu-latest needs: update permissions: write-all - # Only if changes were comitted if: ${{ needs.update.outputs.changes == 'true' }} steps: - # Checkout code # https://github.com/marketplace/actions/checkout - name: Checkout uses: actions/checkout@v4 - # Run workflow # https://cli.github.com/manual/gh_workflow_run - name: Trigger workflow env: diff --git a/.github/workflows/DependabotAutoMerge.yml b/.github/workflows/DependabotAutoMerge.yml index 15505d2..63fb5f3 100644 --- a/.github/workflows/DependabotAutoMerge.yml +++ b/.github/workflows/DependabotAutoMerge.yml @@ -16,7 +16,6 @@ jobs: contents: write pull-requests: write - # Only for dependabot PRs if: github.actor == 'dependabot[bot]' steps: diff --git a/README.md b/README.md index e879c87..1fd9e46 100644 --- a/README.md +++ b/README.md @@ -20,17 +20,12 @@ Packages published on [NuGet](https://www.nuget.org/packages/InsaneGenius.Utilit ## Language Matching -### Language Data Sources - -- ISO 639-2 language data is sourced from the [ISO 639-2 Registration Authority](https://www.loc.gov/standards/iso639-2/langhome.html), [download](https://www.loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt) -- ISO 639-3 language data is sourced from the [ISO 639-3 Registration Authority](https://iso639-3.sil.org/), [download](https://iso639-3.sil.org/sites/iso639-3/files/downloads/iso-639-3.tab). -- RFC 5646 / BCP 47 language data is sourced from the [IANA Tags for Identifying Languages RFC 5646](https://www.rfc-editor.org/rfc/rfc5646.html), [download](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry). - -### Update Language Content - -- If Windows install [wget for Windows](https://winget.run/pkg/JernejSimoncic/Wget) : `winget install -e --id JernejSimoncic.Wget` -- [Run Task](./.vscode/tasks.json) : `build language files` - -### Language Matching Usage - -Refer to [PlexCleaner/Language.cs](https://github.com/ptr727/PlexCleaner/blob/main/PlexCleaner/Language.cs) for an example. +- Language Data Sources: + - ISO 639-2 language data is sourced from the [ISO 639-2 Registration Authority](https://www.loc.gov/standards/iso639-2/langhome.html), [download](https://www.loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt) + - ISO 639-3 language data is sourced from the [ISO 639-3 Registration Authority](https://iso639-3.sil.org/), [download](https://iso639-3.sil.org/sites/iso639-3/files/downloads/iso-639-3.tab). + - RFC 5646 / BCP 47 language data is sourced from the [IANA Tags for Identifying Languages RFC 5646](https://www.rfc-editor.org/rfc/rfc5646.html), [download](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry). +- Manually update language content: + - If Windows install [wget for Windows](https://winget.run/pkg/JernejSimoncic/Wget) : `winget install -e --id JernejSimoncic.Wget` + - [Run Task](./.vscode/tasks.json) : `build language files` +- Language matching usage: + - Refer to [PlexCleaner/Language.cs](https://github.com/ptr727/PlexCleaner/blob/main/PlexCleaner/Language.cs) as an example.