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 23 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
19 changes: 19 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: build

on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
Piedone marked this conversation as resolved.
Show resolved Hide resolved

steps:
- 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 -p:LangVersion=Latest
49 changes: 49 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: publish

on:
workflow_call:
inputs:
source:
required: false
type: string
secrets:
apikey:
required: true
Piedone marked this conversation as resolved.
Show resolved Hide resolved

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}
- 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 -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:NoWarn=NU5104 -p:TreatWarningsAsErrors=true
- name: Push with dotnet
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:
name: artifacts
path: artifacts