2.11.1 #667
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ master ] | |
paths-ignore: | |
- docs/** | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' | |
INTERNAL_PKG_KEY: ${{ secrets.INTERNAL_PKG_KEY }} | |
outputs: | |
version: ${{ steps.version.outputs.prop }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: get version | |
id: version | |
uses: notiz-dev/github-action-json-property@release | |
with: | |
path: src\OWML.Launcher\OWML.Manifest.json | |
prop_path: version | |
- name: set version - EnableDebugMode | |
uses: jossef/action-set-json-field@v1 | |
with: | |
file: src\SampleMods\OWML.EnableDebugMode\manifest.json | |
field: version | |
value: ${{ steps.version.outputs.prop }} | |
- name: set version - LoadCustomAssets | |
uses: jossef/action-set-json-field@v1 | |
with: | |
file: src\SampleMods\OWML.LoadCustomAssets\manifest.json | |
field: version | |
value: ${{ steps.version.outputs.prop }} | |
- name: set project version | |
uses: roryprimrose/set-vs-sdk-project-version@v1 | |
with: | |
version: ${{ steps.version.outputs.prop }} | |
- name: setup msbuild | |
uses: microsoft/setup-msbuild@v1 | |
- name: setup nuget | |
uses: NuGet/[email protected] | |
- name: restore | |
run: nuget restore OWML.sln | |
- name: build | |
run: msbuild OWML.sln | |
- name: pack | |
run: dotnet pack -o . src\OWML.ModHelper\OWML.ModHelper.csproj -p:NuspecFile=OWML.ModHelper.nuspec -p:NuspecProperties="version=${{ steps.version.outputs.prop }};" | |
- name: upload nuget | |
uses: actions/upload-artifact@v2 | |
with: | |
name: owml-nuget | |
path: OWML.*.nupkg | |
- name: create zip | |
run: | | |
cd src\OWML.Launcher\bin\Debug\net48 | |
mkdir Logs | |
mkdir Mods | |
7z a OWML.zip * | |
- name: upload zip | |
uses: actions/upload-artifact@v2 | |
with: | |
name: owml-zip | |
path: src\OWML.Launcher\bin\Debug\net48\OWML.zip | |
nuget: | |
runs-on: windows-latest | |
needs: build | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: owml-nuget | |
- name: publish | |
run: | | |
dotnet nuget push "OWML.*.nupkg" --api-key ${{ secrets.NUGET_KEY }} --source "https://api.nuget.org/v3/index.json" | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: owml-zip | |
- name: create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ needs.build.outputs.version }} | |
release_name: ${{ needs.build.outputs.version }} | |
- name: upload zip to release | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./OWML.zip | |
asset_name: OWML.zip | |
asset_content_type: application/zip |