Skip to content

Commit

Permalink
housekeeping: Add the release build target (#408)
Browse files Browse the repository at this point in the history
  • Loading branch information
glennawatson committed Oct 5, 2020
1 parent 32c9c93 commit 6e9a789
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 7 deletions.
45 changes: 39 additions & 6 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,30 @@ on:
push:
branches: [ main ]
pull_request:
types: [opened, synchronize, reopened, closed]
branches: [ main ]

env:
configuration: Release
productNamespacePrefix: "DynamicData"
validRelease: ${{ contains(github.event.pull_request.labels.*.name, 'release') && github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true }}
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
source-url: https://api.nuget.org/v3/index.json

jobs:
build:

runs-on: windows-latest

steps:

- name: PR Environment
run: |
echo Release Tag Contained - ${{ contains(github.event.pull_request.labels.*.name, 'release') }}
echo Pull Request - ${{ github.event_name == 'pull_request' }}
echo GitHub Action - ${{ github.event.action == 'closed' }}
echo Pull Request Merged - ${{ github.event.pull_request.merged == true }}
- name: Checkout
uses: actions/checkout@v2
with:
Expand All @@ -26,12 +38,6 @@ jobs:
with:
dotnet-version: 3.1.x

- name: Install Latest NuGet
uses: nuget/setup-nuget@v1
with:
nuget-api-key: ${{ secrets.NuGetAPIKey }}
nuget-version: '5.x'

- name: NBGV
uses: dotnet/nbgv@master
with:
Expand Down Expand Up @@ -70,3 +76,30 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
directory: artifacts/coverage

- name: NuGet Push
if: env.validRelease == 'true'
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
SOURCE_URL: https://api.nuget.org/v3/index.json
run: |
dotnet nuget push -s $SOURCE_URL -k $NUGET_AUTH_TOKEN **/*.nupkg
- name: Changelog
uses: scottbrenner/generate-changelog-action@master
id: changelog
if: env.validRelease == 'true'
env:
REPO: ${{ github.repository }}

- name: Create Release
uses: actions/create-release@v1
if: env.validRelease == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.nbgv.outputs.SemVer2 }}
release_name: Release ${{ steps.nbgv.outputs.SemVer2 }}
body: |
${{ steps.changelog.outputs.changelog }}
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "6.16",
"version": "6.17",
"publicReleaseRefSpec": [
"^refs/heads/main$", // we release out of master
"^refs/heads/preview/.*", // we release previews
Expand Down

0 comments on commit 6e9a789

Please sign in to comment.