Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions #1

Merged
merged 25 commits into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.*
- name: Install dependencies
run: dotnet restore -p:NuGetBuild=True
- name: Build
run: dotnet build --configuration Release --no-restore -p:NuGetBuild=True
- name: Test
run: dotnet test --no-restore -p:NuGetBuild=True
run: dotnet build --configuration Release --no-restore -p:NuGetBuild=True -p:LangVersion=Latest
23 changes: 16 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_call:
inputs:
source:
required: true
required: false
type: string
secrets:
apikey:
Expand All @@ -14,25 +14,34 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: haya14busa/action-cond@v1
id: sourceeval
with:
cond: ${{ inputs.source == '' }}
# default nuget source. TODO change to nuget.org
if_true: "https://nuget.cloudsmith.io/lombiq/open-source-orchard-core-extensions/v3/index.json"
Piedone marked this conversation as resolved.
Show resolved Hide resolved
if_false: "${{ inputs.source == '' }}"
Piedone marked this conversation as resolved.
Show resolved Hide resolved
- name: Print source
run: echo Nuget Source:${{ steps.sourceeval.outputs.value }}
- name: Get the version
id: get_version
run: |
VERSION="${GITHUB_REF_NAME//v}"
echo VERSION:${VERSION}
echo ::set-output name=VERSION::${VERSION}
echo ::set-output name=VERSION::${VERSION}
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.*
- name: Install dependencies
run: dotnet restore -p:NuGetBuild=True
- name: Build
run: dotnet build --configuration Release --no-restore -p:NuGetBuild=True
- name: Test
run: dotnet test --no-restore -p:NuGetBuild=True
run: dotnet build --configuration Release --no-restore -p:NuGetBuild=True -p:LangVersion=Latest
- name: Pack
run: dotnet pack --output artifacts --configuration Release --no-restore --no-build -p:NuGetBuild=True -p:Version=${{ steps.get_version.outputs.VERSION }} -p:TreatWarningsAsErrors=false
run: dotnet pack --output artifacts --configuration Release --no-restore --no-build -p:NuGetBuild=True -p:Version=${{ steps.get_version.outputs.VERSION }} -p:NoWarn=NU5104 -p:TreatWarningsAsErrors=true
- name: Push with dotnet
run: dotnet nuget push artifacts/*.nupkg --api-key ${{ secrets.apikey }} --source ${{ inputs.source }} --skip-duplicate
run: dotnet nuget push artifacts/*.nupkg --api-key ${{ secrets.apikey }} --source ${{ steps.sourceeval.outputs.value }} --skip-duplicate
Piedone marked this conversation as resolved.
Show resolved Hide resolved
- name: Archive artifacts
uses: actions/upload-artifact@v1
with:
Expand Down