Skip to content

Commit

Permalink
fix: add workflows (#232)
Browse files Browse the repository at this point in the history
* fix: add workflows

* feat: move to dotnet 6.0.3

BREAKING CHANGE: move to dotnet 6.0.3

* chore(release): 12.0.0 [skip ci]

# [12.0.0](v11.1.1...v12.0.0) (2022-03-28)

### Features

* move to dotnet 6.0.3 ([dc63d65](dc63d65))

### BREAKING CHANGES

* move to dotnet 6.0.3

* build(deps): bump semver-regex from 3.1.2 to 3.1.3

Bumps [semver-regex](https://github.com/sindresorhus/semver-regex) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/sindresorhus/semver-regex/releases)
- [Commits](https://github.com/sindresorhus/semver-regex/commits)

---
updated-dependencies:
- dependency-name: semver-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix: bump projection/event-handling

* chore(release): 12.0.1 [skip ci]

## [12.0.1](v12.0.0...v12.0.1) (2022-04-29)

### Bug Fixes

* bump projection/event-handling ([154b0c4](154b0c4))

* feat: upgrade to net6.0 (#227)

* feat: upgrade to net6.0 (#231)

* feat: upgrade to net6.0

* fix: add System.Formats.Asn1

* fix: fix tests

* chore(release): 12.1.0 [skip ci]

# [12.1.0](v12.0.1...v12.1.0) (2022-12-29)

### Features

* upgrade to net6.0 ([#227](#227)) ([79c15ca](79c15ca))
* upgrade to net6.0 ([#231](#231)) ([a0f1f92](a0f1f92))

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: pgallik <[email protected]>
Co-authored-by: release-bot <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Arne Dumarey <[email protected]>
Co-authored-by: release-bot <[email protected]>
  • Loading branch information
6 people authored Dec 29, 2022
1 parent 37909ad commit 60cea07
Show file tree
Hide file tree
Showing 2 changed files with 220 additions and 0 deletions.
99 changes: 99 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Build

on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:

jobs:
build:
if: github.repository_owner == 'Informatievlaanderen'
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Cache Paket
uses: actions/cache@v3
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: Parse repository name
run: echo REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//") >> $GITHUB_ENV
shell: bash

- name: Setup .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ secrets.VBR_DOTNET_VERSION }}

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

- name: Restore packages
shell: bash
run: |
dotnet tool restore
dotnet paket install
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/cache@v1
with:
path: ./.sonar/scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner

- name: Install DotCover
shell: bash
run: |
dotnet tool install --global JetBrains.dotCover.GlobalTool
- name: Install SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: bash
run: |
mkdir .sonar
mkdir .sonar/scanner
dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner
- name: Sonar begin build & analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.VBR_SONAR_TOKEN }}
shell: bash
run: |
./.sonar/scanner/dotnet-sonarscanner begin /k:"Informatievlaanderen_projector" /o:"informatievlaanderen" /d:sonar.login="${{ secrets.VBR_SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html > /dev/null 2>&1
- name: Build
shell: bash
run: |
dotnet build --nologo --no-restore --no-incremental --configuration Debug Be.Vlaanderen.Basisregisters.Projector.sln
- name: Test
shell: bash
run: dotnet dotcover test --dcReportType=HTML --nologo --no-build Be.Vlaanderen.Basisregisters.Projector.sln

- name: Sonar end build & analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.VBR_SONAR_TOKEN }}
shell: bash
run: |
./.sonar/scanner/dotnet-sonarscanner end /d:sonar.login="${{ secrets.VBR_SONAR_TOKEN }}" > /dev/null 2>&1
121 changes: 121 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: CI

on:
workflow_dispatch:

jobs:
build:
if: github.repository_owner == 'Informatievlaanderen'
name: Release
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Cache NPM
uses: actions/cache@v3
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@v3
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@v3
env:
cache-name: cache-pip
with:
path: ~/.cache/pip
key: ${{ runner.os }}-build-${{ env.cache-name }}

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

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

- name: Setup .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ secrets.VBR_DOTNET_VERSION }}

- name: Set up Python
uses: actions/setup-python@v3
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: ${{ secrets.VBR_GIT_USER }}
GIT_AUTHOR_NAME: ${{ secrets.VBR_GIT_USER }}
GIT_COMMITTER_NAME: ${{ secrets.VBR_GIT_USER }}
GIT_EMAIL: ${{ secrets.VBR_GIT_EMAIL }}
GIT_AUTHOR_EMAIL: ${{ secrets.VBR_GIT_EMAIL }}
GIT_COMMITTER_EMAIL: ${{ secrets.VBR_GIT_EMAIL }}

- name: Set Release Version
run: |
[ ! -f semver ] && echo none > semver
echo RELEASE_VERSION=$(cat semver) >> $GITHUB_ENV
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
node packages/Be.Vlaanderen.Basisregisters.Build.Pipeline/Content/ci-nuget.js dist/$LIBNAME/$LIBNAME.Microsoft.$SEMVER.nupkg
env:
LIBNAME: Be.Vlaanderen.Basisregisters.Projector
SEMVER: ${{ env.RELEASE_VERSION }}
NUGET_HOST: ${{ secrets.NUGET_HOST }}
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:
CONFLUENCE_TITLE: ${{ env.REPOSITORY_NAME }}
CONFLUENCE_USERNAME: ${{ secrets.VBR_CONFLUENCE_USER }}
CONFLUENCE_PASSWORD: ${{ secrets.VBR_CONFLUENCE_PASSWORD }}

0 comments on commit 60cea07

Please sign in to comment.