Use .NET 8 SDK #812
Workflow file for this run
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
name: Build, Test, Package and Push | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on pull request events and merges/pushes to main | |
push: | |
branches: | |
- main | |
- release/* | |
tags-ignore: | |
- '**' | |
pull_request: | |
types: [opened, synchronize, reopened] | |
schedule: | |
# Daily 5am australian/brisbane time | |
- cron: '0 19 * * *' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Pass branch and patch number to Nuke OctoVersion | |
# (for pull_request events we override the /refs/pull/xx/merge branch to the PR's head branch) | |
env: | |
OCTOVERSION_CurrentBranch: ${{ github.head_ref || github.ref }} | |
OCTOVERSION_Patch: ${{ github.run_number }} | |
AssentNonInteractive: true | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # all | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 8.0.x | |
# Adjustment is done prior to Nuke build as OCTOVERSION information is included in the result package. | |
- name: Append OCTOVERSION_CurrentBranch with -nightly (for scheduled) | |
if: github.event_name == 'schedule' | |
run: echo "OCTOVERSION_CurrentBranch=${{ env.OCTOVERSION_CurrentBranch }}-nightly" >> $GITHUB_ENV | |
- name: Nuke Build π | |
id: build | |
shell: bash | |
run: ./build.sh | |
- name: Tag release (when not pre-release) π·οΈ | |
id: github-tag | |
if: ${{ github.event_name != 'schedule' && !contains( steps.build.outputs.octoversion_fullsemver, '-' ) }} | |
uses: actions/github-script@v3 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
github.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: "refs/tags/${{ steps.build.outputs.octoversion_fullsemver }}", | |
sha: context.sha | |
}) | |
- name: Install Octopus CLI π | |
uses: OctopusDeploy/[email protected] | |
with: | |
version: latest | |
- name: Push to Octopus π | |
uses: OctopusDeploy/[email protected] | |
with: | |
server: ${{ secrets.DEPLOY_URL }} | |
space: Integrations | |
api_key: ${{ secrets.DEPLOY_API_KEY }} | |
packages: | | |
./artifacts/Octopus.Versioning.${{ steps.build.outputs.octoversion_fullsemver }}.nupkg | |
- name: Create Release in Octopus π | |
uses: OctopusDeploy/[email protected] | |
with: | |
server: ${{ secrets.DEPLOY_URL }} | |
space: Integrations | |
api_key: ${{ secrets.DEPLOY_API_KEY }} | |
project: "Versioning" | |
packages: | | |
Octopus.Versioning:${{ steps.build.outputs.octoversion_fullsemver }} |