Skip to content

Bump GHA artifact tasks to v4. #80

Bump GHA artifact tasks to v4.

Bump GHA artifact tasks to v4. #80

Workflow file for this run

name: Continuous Integration
on:
push:
branches:
- main
- preview
paths-ignore:
- '**.md'
pull_request:
branches:
- main
- preview
paths-ignore:
- '**.md'
workflow_dispatch:
jobs:
compile:
runs-on: ubuntu-20.04
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.x'
- name: Build
run: dotnet build --configuration Release
build:
runs-on: ubuntu-20.04
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: compile
outputs:
version: ${{ steps.vars.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.x'
- name: Version and Tag
id: bump_version
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: patch
RELEASE_BRANCHES: main
WITH_V: true
PRERELEASE_SUFFIX: alpha
PRERELEASE: ${{ github.ref != 'main' }}
- name: Prepare Outputs
id: vars
run: |
echo "::set-output name=version::$(echo ${{ steps.bump_version.outputs.tag }} | sed 's/[v]//g')"
- name: Build Release Binaries
id: build
run: dotnet build --configuration Release -p:Version=${{ steps.vars.outputs.version }}
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: Binaries
path: bin/Release/
if-no-files-found: error
nuget:
runs-on: ubuntu-20.04
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: build
steps:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.x'
- name: Download Release Artifacts
uses: actions/download-artifact@v4
with:
name: Binaries
path: bin/Release/
- name: NuGet Publish
run: dotnet nuget push bin/Release/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json
- name: GitHub Publish
run: dotnet nuget push bin/Release/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/nwn-dotnet/index.json