Skip to content

Commit

Permalink
(GH-36) Add GitHub Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gep13 committed Feb 24, 2021
1 parent 76c9cd1 commit 804f321
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Build

on:
push:
paths-ignore:
- "README.md"
pull_request:

jobs:
build:
runs-on: ${{ matrix.os }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]

env:
AZURE_PASSWORD: ${{ secrets.AZURE_PASSWORD }}
AZURE_SOURCE: ${{ secrets.AZURE_SOURCE }}
AZURE_USER: ${{ secrets.AZURE_USER }}
GITHUB_PAT: ${{ secrets.GH_TOKEN }}
GITTER_ROOM_ID: ${{ secrets.GITTER_ROOM_ID }}
GPR_PASSWORD: ${{ secrets.GPR_PASSWORD }}
GPR_SOURCE: ${{ secrets.GPR_SOURCE }}
GPR_USER: ${{ secrets.GPR_USER }}
GITTER_TOKEN: ${{ secrets.GITTER_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 }}
WYAM_ACCESS_TOKEN: ${{ secrets.WYAM_ACCESS_TOKEN }}
WYAM_DEPLOY_BRANCH: "gh-pages"
WYAM_DEPLOY_REMOTE: ${{ github.event.repository.html_url }}
steps:
- name: Checkout the repository
uses: actions/checkout@v2

- name: Fetch all tags and branches
run: git fetch --prune --unshallow

This comment has been minimized.

Copy link
@gitfool

gitfool Feb 26, 2021

Contributor

@gep13 this hack has not been needed with GHA since they added fetch-depth. See gitfool/Cake.Dungeon@9713d4f.

This comment has been minimized.

Copy link
@gep13

gep13 Feb 26, 2021

Author Member

@gitfool we have went back on forth a number of times on this, and after discussions between @AdmiringWorm @nils-a @augustoproiete and others, we settled on using this approach.

Is there something "wrong" with using this?

This comment has been minimized.

Copy link
@gitfool

gitfool Feb 27, 2021

Contributor

@gep13 nothing wrong with this, except (again) it's now not needed so completely redundant. I've been through this loop and was just pointing it out because I thought maybe you missed that it's been fixed in actions/checkout@v2. See actions/checkout#113 (comment) and actions/checkout#258.

Specifically, you can replace two actions:

      - name: Checkout the repository
        uses: actions/checkout@v2

      - name: Fetch all tags and branches
        run: git fetch --prune --unshallow

with one:

      - name: Checkout the repository
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

- name: Cache Tools
uses: actions/cache@v2
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}

- name: Build project
uses: cake-build/cake-action@v1
with:
script-path: recipe.cake
target: CI
verbosity: Normal
cake-version: 0.38.5
cake-bootstrap: true

- name: Upload Issues-Report
uses: actions/upload-artifact@v2
with:
if-no-files-found: warn
name: issues
path: BuildArtifacts/report.html

- name: Upload Packages
uses: actions/upload-artifact@v2
with:
if-no-files-found: warn
name: package
path: BuildArtifacts/Packages/**/*

0 comments on commit 804f321

Please sign in to comment.