Skip to content

Pre-release

Pre-release #52

Workflow file for this run

name: GitHub CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build-nugets:
name: 🚀 Pack ${{matrix.projectName}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
projectName:
- LanguageIdentification.CLD2.Native
- LanguageIdentification.CLD2
- LanguageIdentification.CLD3.Native
- LanguageIdentification.CLD3
- LanguageIdentification.FastText.Native
- LanguageIdentification.FastText
- LanguageIdentification.Whatlang.Native
- LanguageIdentification.Whatlang
permissions:
contents: read
packages: write
env:
ROOT: ./src
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: 📂 Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.100
source-url: https://nuget.pkg.github.com/${{github.repository_owner}}/index.json
- name: 📂 Files
working-directory: ${{env.ROOT}}
run: ls -R
- name: 🚀 Pack ${{matrix.projectName}}
working-directory: ${{env.ROOT}}/${{matrix.projectName}}
run: dotnet pack -c Release -o out
- uses: actions/upload-artifact@v4
with:
name: build-nugets
path: ${{env.ROOT}}/${{matrix.projectName}}/out
retention-days: 1
overwrite: 'true'
test-nugets:
name: 🧪 Test ${{matrix.projectName}}
runs-on: ubuntu-latest
needs: build-nugets
permissions:
contents: read
packages: write
env:
ROOT: ./src
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions/download-artifact@v4
with:
name: build-nugets
path: ${{env.ROOT}}
- name: 📂 Build Docker Image \#1
working-directory: ${{env.ROOT}}
run: docker build -f ./test.Dockerfile -t local-dotnet-test-sdk:latest .
- name: 📂 Build Docker Image \#2
working-directory: ${{env.ROOT}}
run: docker build -f ./test-ci.Dockerfile -t local-dotnet-test-ci-sdk:latest .
- name: 🧪 Test
working-directory: ${{env.ROOT}}
run: docker run --rm -v $(pwd):/src local-dotnet-test-ci-sdk:latest
deploy-nugets:
name: 🚚 Push ${{matrix.projectName}}
runs-on: ubuntu-latest
needs: test-nugets
if: github.ref == 'refs/heads/master'
strategy:
fail-fast: false
matrix:
projectName:
- LanguageIdentification.CLD2.Native
- LanguageIdentification.CLD2
- LanguageIdentification.CLD3.Native
- LanguageIdentification.CLD3
- LanguageIdentification.FastText.Native
- LanguageIdentification.FastText
- LanguageIdentification.Whatlang.Native
- LanguageIdentification.Whatlang
permissions:
contents: read
packages: write
env:
ROOT: ./src
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions/download-artifact@v4
with:
name: build-nugets
path: ${{env.ROOT}}
- name: 📂 Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.100
source-url: https://nuget.pkg.github.com/${{github.repository_owner}}/index.json
- name: 📂 Files
working-directory: ${{env.ROOT}}
run: ls -R
- name: 🚚 Push ${{matrix.projectName}} to GitHub registry
working-directory: ${{env.ROOT}}/${{matrix.projectName}}
run: dotnet nuget push ./out/*.nupkg --skip-duplicate -k ${{env.NUGET_AUTH_TOKEN}}
- uses: geekyeggo/delete-artifact@v1
with:
name: build-nugets