Merge pull request #362 from cake-build/dependabot/gradle/src/rider/d… #698
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 | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
- "feature/**" | |
- "release/**" | |
- "hotfix/**" | |
tags: | |
- "*" | |
paths-ignore: | |
- "README.md" | |
pull_request: | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
NUGET_SOURCE: "https://api.nuget.org/v3/index.json" | |
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} | |
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} | |
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }} | |
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }} | |
PUBLISH_TOKEN: ${{ secrets.JB_PUBLISH_TOKEN }} | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ windows-2022, ubuntu-22.04, macos-12 ] | |
steps: | |
- name: Checkout the requested branch | |
uses: actions/checkout@v3 | |
- name: Fetch all tags and branches | |
run: git fetch --prune --unshallow | |
# Validates the gradle wrappers and saves us from getting malicious PRs | |
- name: Gradle Wrapper Validation | |
uses: gradle/[email protected] | |
# Setup Java 11 environment which is needed to build | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
# Setup dotnet 6 (and 2.1 for Wyam, 3.1 for gitReleaseManager, 5.0 for gitVersion) | |
- name: Setup dotnet | |
uses: actions/[email protected] | |
with: | |
dotnet-version: | | |
2.1.x | |
3.1.x | |
5.0.x | |
6.0.x | |
# Cache Gradle Wrapper | |
- name: Setup Gradle Wrapper Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
# install libgit2-dev on ubuntu, so libgit2sharp works | |
- name: Install libgit-dev | |
if: runner.os == 'Linux' | |
run: sudo apt-get install -y libgit2-dev | |
# Cache Cake tools | |
- name: Cache Tools | |
uses: actions/cache@v3 | |
with: | |
path: tools | |
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }} | |
- name: Build project | |
uses: cake-build/[email protected] | |
with: | |
script-path: recipe.cake | |
target: CI | |
cake-version: tool-manifest | |
# currently, Cake.Recipe does not upload artifacts when run on gh-actions | |
- name: Upload Issues | |
uses: actions/upload-artifact@v3 | |
with: | |
if-no-files-found: warn | |
name: ${{ matrix.os }} Issues | |
path: | | |
BuildArtifacts/report.html | |
BuildArtifacts/**/coverlet/*.xml | |
- name: Upload Packages | |
uses: actions/upload-artifact@v3 | |
if: runner.os == 'Linux' | |
with: | |
if-no-files-found: warn | |
name: package | |
path: BuildArtifacts/Packages/**/* |