Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

Build, Test, Package and Push #726

Build, Test, Package and Push

Build, Test, Package and Push #726

Workflow file for this run

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:
- '**'
tags-ignore:
- '**'
schedule:
# Daily 5am australian/brisbane time
- cron: '19 0 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
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: 5.0.x
- name: Configure GitHub package source πŸ™
id: package-source
shell: bash
run: dotnet nuget update source GitHub --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text
- name: Nuke Build πŸ—
id: build
env:
OCTOVERSION_CurrentBranch: ${{ github.head_ref || github.ref }} # For pull_request events we override the /refs/pull/xx/merge branch to the PR's head branch
OCTOVERSION_Patch: ${{ github.run_number }}
JiraIntegration_E2E_BaseUrl: ${{ secrets.JIRA_BASE_URL }}
JiraIntegration_E2E_Username: ${{ secrets.JIRA_USERNAME }}
JiraIntegration_E2E_AuthToken: ${{ secrets.JIRA_AUTH_TOKEN }}
shell: bash
run: ./build.sh --verbosity verbose
- name: Push package to GitHub πŸ™
id: push-github
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' && github.event_name != 'schedule'
shell: bash
run: dotnet nuget push artifacts/**/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "GitHub"
- name: Push package to feed πŸ™
id: push-feed
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' && github.event_name != 'schedule'
shell: bash
env:
FEED_API_KEY: ${{ secrets.FEED_API_KEY }}
FEED_SOURCE: ${{ secrets.FEED_SOURCE }}
run: dotnet nuget push artifacts/**/*.nupkg --api-key "$FEED_API_KEY" --source "$FEED_SOURCE"
- name: GitHub Tag 🏷
id: github-tag
uses: actions/github-script@v3
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' && github.event_name != 'schedule' && steps.build.outputs.prerelease_tag == ''
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ steps.build.outputs.semver }}",
sha: context.sha
})