Skip to content

Commit

Permalink
ci: migrate github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jcdcdev committed Nov 8, 2023
1 parent a5bc4b6 commit 9df43df
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 78 deletions.
28 changes: 11 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
name: Build Package

name: Build
on:
pull_request:
branches: "*"
workflow_dispatch:
jobs:
build:

runs-on: windows-latest

steps:

- name: Checkout repository
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x

- name: Build project
run: dotnet build src\jcdcdev.Umbraco.Core\jcdcdev.Umbraco.Core.csproj --configuration Release
permissions:
contents: write
uses: jcdcdev/jcdcdev.Github.UmbracoSimpleDeploy/.github/workflows/build-release-template.yml@main
with:
project-name: 'jcdcdev.Umbraco.Core'
project-path: './src/jcdcdev.Umbraco.Core/jcdcdev.Umbraco.Core.csproj'
deploy: false
secrets:
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
72 changes: 11 additions & 61 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,17 @@
name: Release Package
run-name: >
push NuGet ${{ github.repository}} #${{ github.run_number }}
name: Release
on:
pull_request:
branches:
- main
types: [closed]
branches: [ "main" ]
types: [ closed ]
workflow_dispatch:
jobs:
determine-version:
runs-on: ubuntu-latest
outputs:
semVer: ${{ steps.gitversion.outputs.semVer }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'
- name: Determine Version
id: gitversion # id to later be referenced
uses: gittools/actions/gitversion/execute@v0
build:
name: push ${{ needs.determine-version.outputs.semVer }}
runs-on: windows-latest
needs: determine-version
env:
SEMVER: ${{ needs.determine-version.outputs.semVer }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Build project
run: dotnet build src\jcdcdev.Umbraco.Core\jcdcdev.Umbraco.Core.csproj --configuration Release -p:Version=${{ env.SEMVER }}

- name: Pack
run: dotnet pack src\jcdcdev.Umbraco.Core\jcdcdev.Umbraco.Core.csproj --configuration Release -p:Version=${{ env.SEMVER }} --no-build --output .

- name: Push to NuGet
run: dotnet nuget push **\*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json
post-deploy:
runs-on: ubuntu-latest
needs:
- determine-version
- build
env:
SEMVER: ${{ needs.determine-version.outputs.semVer }}
name: post-deploy ${{ needs.determine-version.outputs.semVer }}
build_release:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Tag commit
env:
TAG: ${{ env.SEMVER }}
MESSAGE: ""
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git tag -a "${TAG}" -m "${MESSAGE}"
git push origin "${TAG}"
uses: jcdcdev/jcdcdev.Github.UmbracoSimpleDeploy/.github/workflows/build-release-template.yml@main
with:
project-name: 'jcdcdev.Umbraco.Core'
project-path: './src/jcdcdev.Umbraco.Core/jcdcdev.Umbraco.Core.csproj'
deploy: true
secrets:
nuget-api-key: ${{ secrets.NUGET_API_KEY }}

0 comments on commit 9df43df

Please sign in to comment.