Skip to content

Commit

Permalink
Merge pull request #190 from ptr727/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ptr727 authored Jul 10, 2024
2 parents e02a018 + 36195ea commit 693a7e1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 45 deletions.
28 changes: 7 additions & 21 deletions .github/workflows/BuildPublishPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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: >-
Expand All @@ -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' }}
Expand All @@ -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' }}
Expand All @@ -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
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/CheckForNewLanguageData.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Check for new language data
on:
workflow_dispatch:
schedule:
# Daily 2am
- cron: '0 2 * * *'

concurrency:
Expand All @@ -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
Expand All @@ -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:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/DependabotAutoMerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
contents: write
pull-requests: write

# Only for dependabot PRs
if: github.actor == 'dependabot[bot]'

steps:
Expand Down
23 changes: 9 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 693a7e1

Please sign in to comment.