Skip to content

Commit

Permalink
fix: move to GH-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Wouter De Rijck authored and CumpsD committed May 7, 2020
1 parent 978dd10 commit 385096d
Show file tree
Hide file tree
Showing 9 changed files with 294 additions and 386 deletions.
77 changes: 0 additions & 77 deletions .circleci/config.yml

This file was deleted.

121 changes: 121 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: CI

on:
push:
branches: [ master ]

jobs:
build:
if: github.repository == 'Informatievlaanderen/http-logging-filter'
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v2.1.0

- name: Cache NPM
uses: actions/cache@v1.1.2
env:
cache-name: cache-npm
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Cache Paket
uses: actions/cache@v1.1.2
env:
cache-name: cache-paket
with:
path: packages
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('paket.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Cache Python
uses: actions/cache@v1.1.2
env:
cache-name: cache-pip
with:
path: ~/.cache/pip
key: ${{ runner.os }}-build-${{ env.cache-name }}

- name: Parse repository name
run: echo ::set-env name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//")
shell: bash

- name: Setup Node.js
uses: actions/setup-node@v1.4.1

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.201

- name: Set up Python
uses: actions/setup-python@v1.2.0
with:
python-version: '3.x'

- name: Node version
shell: bash
run: node --version

- name: .NET version
shell: bash
run: dotnet --info

- name: Python version
shell: bash
run: python --version

- name: Install NPM dependencies
shell: bash
run: npm install

- name: Install Python dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install requests markdown argparse
- name: Run Semantic Release
shell: bash
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_COMMIT: ${{ github.sha }}
GIT_USERNAME: release-bot
GIT_AUTHOR_NAME: release-bot
GIT_COMMITTER_NAME: release-bot
GIT_EMAIL: informatie.vlaanderen@vlaanderen.be
GIT_AUTHOR_EMAIL: informatie.vlaanderen@vlaanderen.be
GIT_COMMITTER_EMAIL: informatie.vlaanderen@vlaanderen.be

- name: Set Release Version
run: |
[ ! -f semver ] && echo none > semver
echo ::set-env name=RELEASE_VERSION::$(cat semver)
shell: bash

- name: Publish to NuGet
if: env.RELEASE_VERSION != 'none'
shell: bash
run: |
node packages/Be.Vlaanderen.Basisregisters.Build.Pipeline/Content/ci-nuget.js dist/$LIBNAME/$LIBNAME.$SEMVER.nupkg
env:
LIBNAME: Be.Vlaanderen.Basisregisters.AspNetCore.Mvc.Logging
SEMVER: ${{ env.RELEASE_VERSION }}
NUGET_HOST: https://www.nuget.org
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

- name: Publish to Confluence
if: env.RELEASE_VERSION != 'none'
shell: bash
run: ./packages/Be.Vlaanderen.Basisregisters.Build.Pipeline/Content/ci-confluence.sh
env:
CIRCLE_PROJECT_REPONAME: ${{ env.REPOSITORY_NAME }}
CONFLUENCE_USERNAME: david.cumps@vlaanderen.be
CONFLUENCE_PASSWORD: ${{ secrets.CONFLUENCE_PASSWORD }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Be.Vlaanderen.Basisregisters.AspNetCore.Mvc.Logging
# Be.Vlaanderen.Basisregisters.AspNetCore.Mvc.Logging [![Build Status](https://github.com/Informatievlaanderen/http-logging-filter/workflows/CI/badge.svg)](https://github.com/Informatievlaanderen/http-logging-filter/actions)

A filter which logs HTTP calls.
By default logs `POST` and `PUT`.
Expand Down
23 changes: 12 additions & 11 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
version 5.241.6
framework: netstandard20
source https://api.nuget.org/v3/index.json
nuget Be.Vlaanderen.Basisregisters.Build.Pipeline 3.3.2 //"
nuget Be.Vlaanderen.Basisregisters.Build.Pipeline 4.0.6 //"

#load "packages/Be.Vlaanderen.Basisregisters.Build.Pipeline/Content/build-generic.fsx"

Expand All @@ -17,27 +17,28 @@ let build = buildSolution assemblyVersionNumber
let publish = publishSolution assemblyVersionNumber
let pack = packSolution nugetVersionNumber

// Library ------------------------------------------------------------------------
supportedRuntimeIdentifiers <- [ "linux-x64" ]

// Library ------------------------------------------------------------------------
Target.create "Lib_Build" (fun _ -> build "Be.Vlaanderen.Basisregisters.AspNetCore.Mvc.Logging")

Target.create "Lib_Publish" (fun _ -> publish "Be.Vlaanderen.Basisregisters.AspNetCore.Mvc.Logging")
Target.create "Lib_Pack" (fun _ -> pack "Be.Vlaanderen.Basisregisters.AspNetCore.Mvc.Logging")

// --------------------------------------------------------------------------------

Target.create "PublishLibrary" ignore
Target.create "PublishAll" ignore

Target.create "PackageMyGet" ignore
Target.create "PackageAll" ignore

// Publish ends up with artifacts in the build folder
"DotNetCli" ==> "Clean" ==> "Restore" ==> "Lib_Build" ==> "Lib_Publish" ==> "PublishLibrary"
"PublishLibrary" ==> "PublishAll"
"DotNetCli"
==> "Clean"
==> "Restore"
==> "Lib_Build"
==> "Lib_Publish"
==> "PublishAll"

// Package ends up with local NuGet packages
"PublishLibrary" ==> "Lib_Pack" ==> "PackageMyGet"
"PackageMyGet" ==> "PackageAll"
"PublishAll"
==> "Lib_Pack"
==> "PackageAll"

Target.runOrDefault "Lib_Build"
Loading

0 comments on commit 385096d

Please sign in to comment.