-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update workflow to separate build and release work (#1)
* Update workflow to separate build and release work * Update to syncromatics/gogitver-action v0.0.7
- Loading branch information
Showing
1 changed file
with
27 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,53 @@ | ||
name: dotnet package | ||
|
||
on: [push] | ||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/master' | ||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
ref: ${{ github.ref }} | ||
- run: git checkout "${GITHUB_REF:11}" | ||
- uses: syncromatics/[email protected].4 | ||
- uses: syncromatics/[email protected].7 | ||
id: gogitver | ||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: "6.0" | ||
- run: make build package ship | ||
- uses: actions/cache@v3 | ||
with: | ||
path: artifacts | ||
key: ${{ steps.gogitver.outputs.version }}-artifacts | ||
- run: make build package | ||
env: | ||
VERSION: ${{ steps.gogitver.outputs.version }} | ||
outputs: | ||
version: ${{ steps.gogitver.outputs.version }} | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: github.ref == 'refs/heads/master' | ||
steps: | ||
- uses: actions/cache@v3 | ||
with: | ||
path: artifacts | ||
key: ${{ needs.build.outputs.version }}-artifacts | ||
fail-on-cache-miss: true | ||
- run: make ship | ||
env: | ||
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.gogitver.outputs.version }} | ||
release_name: Release ${{ steps.gogitver.outputs.version }} | ||
tag_name: ${{ needs.build.outputs.version }} | ||
release_name: Release ${{ needs.build.outputs.version }} | ||
draft: false | ||
prerelease: false | ||
- uses: actions/[email protected] | ||
|