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

Commit

Permalink
chore: rework CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ViRb3 committed May 20, 2020
1 parent c76e498 commit a0d0e7a
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 28 deletions.
69 changes: 41 additions & 28 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,49 @@
name: CI

on: [push]
on:
push:
branches: [develop]
pull_request:
branches: [develop]

jobs:
build:

runs-on: [windows-2019]

steps:
- name: Setup MSBuild.exe
uses: warrenbuckley/Setup-MSBuild@v1

- name: Setup Nuget.exe
uses: warrenbuckley/Setup-Nuget@v1

- uses: actions/checkout@v1
- name: Build
run: |
cd source
git submodule update --init --recursive
nuget restore SylphyHorn.sln
msbuild SylphyHorn.sln /p:Configuration=Release /m /verbosity:normal /p:WarningLevel=0
- name: Create ZIP
if: startsWith(github.ref, 'refs/tags/')
run: |
Rename-Item -Path "source/SylphyHorn/bin/Release" -NewName "SylphyHornEx"
Compress-Archive -Path "source/SylphyHorn/bin/SylphyHornEx" -DestinationPath SylphyHornEx.zip
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: SylphyHornEx.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup MSBuild.exe
uses: warrenbuckley/Setup-MSBuild@v1

- name: Setup Nuget.exe
if: success()
uses: warrenbuckley/Setup-Nuget@v1

- name: Checkout
if: success()
uses: actions/checkout@v2
with:
token: ${{ secrets.API_GITHUB_TOKEN }}

- name: Build
if: success()
run: |
cd source
git submodule update --init --recursive
nuget restore SylphyHorn.sln
msbuild SylphyHorn.sln /p:Configuration=Release /m /verbosity:normal /p:WarningLevel=0
- name: Create ZIP
if: success()
run: |
Rename-Item -Path "source/SylphyHorn/bin/Release" -NewName "SylphyHornEx"
Compress-Archive -Path "source/SylphyHorn/bin/SylphyHornEx" -DestinationPath SylphyHornEx.zip
- name: Release
if: success()
uses: cycjimmy/semantic-release-action@v2.3.0
with:
extra_plugins: |
@semantic-release/git@9.0.0
@google/semantic-release-replace-plugin@1.0.0
env:
GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }}
53 changes: 53 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"branches": [
"develop"
],
"plugins": [
"@semantic-release/commit-analyzer",
[
"@google/semantic-release-replace-plugin",
{
"replacements": [
{
"files": [
"source/SylphyHorn/Properties/AssemblyInfo.cs"
],
"from": "\\[assembly: AssemblyVersion\\(\".+\"\\)\\]",
"to": "[assembly: AssemblyVersion(\"${nextRelease.version}\")]",
"results": [
{
"file": "source/SylphyHorn/Properties/AssemblyInfo.cs",
"hasChanged": true,
"numMatches": 1,
"numReplacements": 1
}
],
"countMatches": true
}
]
}
],
[
"@semantic-release/git",
{
"assets": [
"source/SylphyHorn/Properties/AssemblyInfo.cs"
],
"message": "chore(release): ${nextRelease.version} [skip ci]"
}
],
"@semantic-release/release-notes-generator",
[
"@semantic-release/github",
{
"successComment": false,
"failComment": false,
"assets": [
{
"path": "SylphyHornEx.zip"
}
]
}
]
]
}

0 comments on commit a0d0e7a

Please sign in to comment.