Update github-ci.yml #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GitHub CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
# DEPLOY NUGETS | |
build_nugets: | |
name: 🚀 Pack ${{matrix.projectName}} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
projectName: | |
- LanguageIdentification.CLD3.Native | |
- LanguageIdentification.CLD3 | |
- LanguageIdentification.FastText.Native | |
- LanguageIdentification.FastText | |
permissions: | |
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@v2 | |
if: github.ref == 'refs/heads/master' | |
with: | |
name: build_nugets | |
path: ${{env.ROOT}}/**/out | |
retention-days: 1 | |
deploy_nugets: | |
name: 🚚 Push ${{matrix.projectName}} | |
runs-on: ubuntu-latest | |
needs: build_nugets | |
if: github.ref == 'refs/heads/master' | |
strategy: | |
fail-fast: false | |
matrix: | |
projectName: | |
- LanguageIdentification.CLD3.Native | |
- LanguageIdentification.CLD3 | |
- LanguageIdentification.FastText.Native | |
- LanguageIdentification.FastText | |
permissions: | |
packages: write | |
env: | |
ROOT: ./src | |
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v2 | |
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 |