Skip to content

Commit

Permalink
Merge pull request #1 from ninjapiratica/readme
Browse files Browse the repository at this point in the history
Add workflows
  • Loading branch information
ninjapiratica authored Oct 23, 2024
2 parents 91070b1 + b576aad commit e43ba30
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: Continuous Integration

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore --configuration Release

# - name: Test
# run: dotnet test --no-build --verbosity normal
32 changes: 32 additions & 0 deletions .github/workflows/release-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: Release Nuget Preview

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+-preview[0-9]*"
jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV

- name: Pack
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output .

- name: Push
run: |
dotnet nuget push NP.Lti13Platform.Core.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_API_KEY}
dotnet nuget push NP.Lti13Platform.AssignmentGradeServices.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_API_KEY}
dotnet nuget push NP.Lti13Platform.DeepLinking.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_API_KEY}
dotnet nuget push NP.Lti13Platform.NameRoleProvisioningService.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_API_KEY}
dotnet nuget push NP.Lti13Platform.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_API_KEY}
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: Release Nuget

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Verify commit exists in origin/main
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/main
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV

- name: Build
run: dotnet build --configuration Release /p:Version=${VERSION}

- name: Pack
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output .

- name: Push
run: |
dotnet nuget push NP.Lti13Platform.Core.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_API_KEY}
dotnet nuget push NP.Lti13Platform.AssignmentGradeServices.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_API_KEY}
dotnet nuget push NP.Lti13Platform.DeepLinking.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_API_KEY}
dotnet nuget push NP.Lti13Platform.NameRoleProvisioningService.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_API_KEY}
dotnet nuget push NP.Lti13Platform.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_API_KEY}
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

0 comments on commit e43ba30

Please sign in to comment.