ci: Release only if tests pass (#1692)

Now we only create a release if the tests pass.

This is done by moving the release steps from appveyor to github actions.
This commit is contained in:
Paul Pacheco 2020-04-11 20:46:44 -05:00 committed by GitHub
parent 18bd792a0b
commit fbe7118689
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 54 additions and 18 deletions

View File

@ -135,3 +135,7 @@ csharp_preserve_single_line_blocks = true
[*.vb] [*.vb]
# Modifier preferences # Modifier preferences
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
[*.yml]
indent_style = space
indent_size = 2

View File

@ -30,8 +30,8 @@ jobs:
name: Manual Activation File name: Manual Activation File
path: ${{ steps.getManualLicenseFile.outputs.filePath }} path: ${{ steps.getManualLicenseFile.outputs.filePath }}
testRunnerInAllModes: CI:
name: Unity test name: Test
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
@ -100,3 +100,50 @@ jobs:
FrameworkPathOverride: /opt/Unity/Editor/Data/MonoBleedingEdge/ FrameworkPathOverride: /opt/Unity/Editor/Data/MonoBleedingEdge/
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Release:
runs-on: windows-latest
needs: CI
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Delete Tests
run: |
Remove-Item -Recurse -Force Assets\Mirror\Tests
Remove-Item -Recurse -Force Assets\Mirror\Tests.meta
- name: Delete Examples
run: |
Remove-Item -Recurse -Force Assets\Mirror\Examples
Remove-Item -Recurse -Force Assets\Mirror\Examples.meta
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.100'
- name: Install unity-packer
run: dotnet tool install -g unity-packer
- name: Package
run: |
unity-packer pack Mirror.unitypackage Assets/Mirror Assets/Mirror Assets/ScriptTemplates Assets/ScriptTemplates LICENSE Assets/Mirror/LICENSE
- uses: actions/upload-artifact@v1
with:
name: Mirror.unitypackage
path: Mirror.unitypackage
- name: Release
uses: cycjimmy/semantic-release-action@v2
with:
extra_plugins: |
@semantic-release/exec
@semantic-release/changelog
@semantic-release/git
branch: master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -24,28 +24,13 @@ install:
# Do not build on tags (GitHub only) # Do not build on tags (GitHub only)
skip_tags: true skip_tags: true
before_build:
- cmd: powershell .\setversion.ps1
build_script: build_script:
- docfx metadata doc\docfx.json - docfx metadata doc\docfx.json
- docfx build doc\docfx.json - docfx build doc\docfx.json
after_build:
- RMDIR /Q /S Assets\Mirror\Tests
- del /F /Q Assets\Mirror\Tests.meta
- UnityPackager pack Mirror.unitypackage Assets/Mirror Assets/Mirror Assets/ScriptTemplates Assets/ScriptTemplates LICENSE Assets/Mirror/LICENSE
artifacts:
- path: Mirror.unitypackage
- path: Assets
name: Mirror
- path: Assets
name: ScriptTemplates
image: Visual Studio 2017 image: Visual Studio 2017
deploy_script: deploy_script:
- semantic-release
- IF "%APPVEYOR_REPO_BRANCH%"=="master" ( lftp -e 'set ftp:ssl-allow no ; mirror -R -c -e -p doc/_site public_html/docs; chmod -R a+X public_html/docs ; ls -l public_html/docs/ ; ls -l public_html/docs/styles/ ; bye' -u mirreofx --env-password ftp://mirror-networking.com 2>&1 ) - IF "%APPVEYOR_REPO_BRANCH%"=="master" ( lftp -e 'set ftp:ssl-allow no ; mirror -R -c -e -p doc/_site public_html/docs; chmod -R a+X public_html/docs ; ls -l public_html/docs/ ; ls -l public_html/docs/styles/ ; bye' -u mirreofx --env-password ftp://mirror-networking.com 2>&1 )