Skip to content

Commit

Permalink
Updated CI for automated releases.
Browse files Browse the repository at this point in the history
  • Loading branch information
DJGosnell committed Aug 5, 2021
1 parent 1ab80f3 commit cd4576b
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
push:
branches:
- '*'
tags:
- 'v*'
pull_request:
branches:
- '*'
release:
types: [published]

jobs:
build:
Expand Down Expand Up @@ -46,6 +46,18 @@ jobs:
with:
path: artifacts/*

- name: Create changelog
if: startsWith(github.ref, 'refs/tags/') && matrix.configuration == 'Release'
run: git log --pretty=format:"- %h %B" "$(git describe --abbrev=0 --tags $(git rev-list --tags --max-count=2) | Select -Last 1)..$(git describe --abbrev=0 --tags $(git rev-list --tags --max-count=2) | Select -First 1)" >> ${{ github.workspace }}/CHANGELOG.TXT

- name: Create release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: "PDFiumCore ${GITHUB_REF#refs/*/} Released"
files: artifacts/*.nupkg
body_path: ${{github.workspace}}/CHANGELOG.TXT

- name: Push Nuget packages
if: github.event_name == 'release' && matrix.configuration == 'Release'
if: startsWith(github.ref, 'refs/tags/') && matrix.configuration == 'Release'
run: dotnet nuget push artifacts/**/*.nupkg --api-key ${{ secrets.ORG_NUGET_AUTH_TOKEN }} --skip-duplicate

0 comments on commit cd4576b

Please sign in to comment.