Skip to content

update workflow files #8

update workflow files

update workflow files #8

# Workflow Code: AngryGoose_v2 DO NOT REMOVE
name: Release (Develop)
on:
pull_request:
types: [closed]
branches:
- develop
jobs:
increment-version:
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'develop'
runs-on: ubuntu-latest
outputs:
NEXT_VERSION: ${{ steps.set-version-output.outputs.NEXT_VERSION }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
# See https://github.com/im-open/git-version for more details around how to increment major/minor/patch through commit messages
- id: get-version
name: Increment the version
uses: im-open/git-version-lite@v2.0.0
with:
calculate-prerelease-version: true
branch-name: ${{ github.base_ref }}
create-ref: true
github-token: ${{ secrets.GITHUB_TOKEN }}
default-release-type: major
- id: set-version-output
name: Set Version Output
run: |
export VERSION="$(echo ${{ steps.get-version.outputs.NEXT_VERSION }} | cut -c 2-)"
echo '::set-output name=NEXT_VERSION::'$VERSION
- run: echo "${{ steps.set-version-output.outputs.NEXT_VERSION }}"
release:
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'develop'
needs: increment-version
env:
DOTNET_VER: "7.0.x"
DOTNET_PREVIEW: false
SRC_DIR: "./src"
SRC_PROJ: "MergeJson.csproj"
PACKAGE_NAME: "MergeJson"
PACKAGE_SOURCE: https://api.nuget.org/v3/index.json
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set VERSION variable from tag
run: echo "VERSION=${{ needs.increment-version.outputs.NEXT_VERSION }}" >> $GITHUB_ENV
- uses: actions/setup-dotnet@v1
with:
dotnet-version: |
7.0.x
6.0.x
include-prerelease: $DOTNET_PREVIEW
- name: Build
run: dotnet build $SRC_DIR/$SRC_PROJ --configuration Release /p:Version=${VERSION}
- name: Pack
run: dotnet pack $SRC_DIR/$SRC_PROJ --configuration Release /p:Version=${VERSION} --output .
- name: Push to GitHub Feed
run: dotnet nuget push $PACKAGE_NAME.${VERSION}.nupkg --source $PACKAGE_SOURCE --api-key ${NUGET_API_KEY}