Skip to content

Commit

Permalink
Merge pull request #28 from cwensley/ci-build
Browse files Browse the repository at this point in the history
Updates and GitHub Actions build
  • Loading branch information
cwensley authored Jan 30, 2021
2 parents c34d79b + 5df0611 commit 8357c92
Show file tree
Hide file tree
Showing 66 changed files with 1,602 additions and 1,453 deletions.
26 changes: 26 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# use tabs by default for everything
[*.cs]
indent_style = tab
indent_size = 4
tab_size = 4
charset=utf-8
csharp_new_line_before_open_brace = all

# packages.config uses spaces
[**\packages.config]
indent_style = space
indent_size = 2

[*.{csproj,vbproj,proj,targets,props}]
indent_style = space
indent_size = 2
tab_size = 2

[*.yml]
intent_style = space
indent_size = 2
117 changes: 117 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Build

on:
push:
branches: [ main ]
tags: [ '*' ]
pull_request:
branches: [ main ]

env:
DotNetVersion: "5.0.x"
BuildConfiguration: "Release"
BuildParameters: "Source/PabloDraw/PabloDraw.csproj /clp:NoSummary /p:Configuration=Release /p:BuildVersion=${{ github.run_id }} /p:BuildBranch=${{ github.ref }}"

jobs:
build-windows:

runs-on: windows-latest

steps:
- uses: actions/checkout@v2

- uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DotNetVersion }}

- run: dotnet publish ${{ env.BuildParameters }} -f net5.0-windows -r win-x64

- uses: actions/upload-artifact@v2
with:
name: pablodraw-windows
path: artifacts/bin/${{ env.BuildConfiguration }}/net5.0-windows/win-x64/publish/*

build-linux:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DotNetVersion }}

- run: dotnet publish ${{ env.BuildParameters }} -f net5.0 -r linux-x64

- uses: actions/upload-artifact@v2
with:
name: pablodraw-linux
path: artifacts/bin/${{ env.BuildConfiguration }}/net5.0/linux-x64/publish/*

build-mac:

runs-on: macos-latest

steps:
- uses: actions/checkout@v2

- uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DotNetVersion }}

- uses: maxim-lobanov/setup-xamarin@v1
with:
mono-version: latest
xamarin-mac-version: latest
xcode-version: latest

# - name: Import code signing certificate
# if: github.event_name != 'pull_request'
# uses: apple-actions/import-codesign-certs@v1
# with:
# p12-file-base64: ${{ secrets.DEVID_CERTIFICATE_P12 }}
# p12-password: ${{ secrets.DEVID_CERTIFICATE_P12_PASSWORD }}

# - name: Enable code signing
# if: github.event_name != 'pull_request'
# run: echo "BuildParameters=${{ env.BuildParameters }} /p:EnableCodeSignBuild=True" >> $GITHUB_ENV

# - name: Set notarization credentials
# if: startsWith(github.ref, 'refs/tags/')
# run: |
# xcrun altool --store-password-in-keychain-item "AC_PASSWORD" -u "${{ secrets.AC_USERNAME }}" -p "${{ secrets.AC_PASSWORD }}"
# echo "BuildParameters=${{ env.BuildParameters }} /p:EnableNotarizationBuild=True" >> $GITHUB_ENV

- run: dotnet build ${{ env.BuildParameters }} -f net5.0 -r osx-x64

- uses: actions/upload-artifact@v2
with:
name: pablodraw-mac
path: artifacts/bin/${{ env.BuildConfiguration }}/net5.0/osx-x64/PabloDraw.dmg

update-release:
needs: [ build-windows, build-mac ]
runs-on: ubuntu-latest
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
steps:
- id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}

- id: get_release
uses: bruceadams/get-release@v1.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/download-artifact@v2
with:
name: pablodraw

# - uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.get_release.outputs.upload_url }}
# asset_path:
# asset_name:
# asset_content_type: application/octet-stream
27 changes: 27 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "PabloDraw",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build-pablodraw",
"osx": {
"program": "${workspaceFolder}/artifacts/bin/${config:var.BuildConfiguration}/net5.0/osx-x64/PabloDraw.app/Contents/MacOS/PabloDraw",
},
"windows": {
"program": "${workspaceFolder}/artifacts/bin/${config:var.BuildConfiguration}/net5.0-windows/win-x64/PabloDraw.exe",
},
"linux": {
"program": "${workspaceFolder}/artifacts/bin/${config:var.BuildConfiguration}/net5.0/linux-x64/PabloDraw",
},
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"console": "internalConsole"
}
]
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"vssolution.altSolutionFolders": [
"Source"
],
"var": {
"BuildConfiguration": "Debug"
}
}
75 changes: 75 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "shell",
"args": [
"build",
"${workspaceFolder}/Source/Pablo Desktop.sln",
"/p:Configuration=Debug",
"/p:Platform=Mac",
"/p:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"group": "build",
"presentation": {
"clear": true
},
"problemMatcher": "$msCompile"
},
{
"label": "build-pablodraw",
"command": "dotnet",
"type": "shell",
"args": [
"build",
"${workspaceFolder}/Source/PabloDraw/PabloDraw.csproj",
// "/p:BuildTarget=Linux",
"/p:Configuration=${config:var.BuildConfiguration}",
"/p:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"group": "build",
"presentation": {
"clear": true
},
"problemMatcher": "$msCompile"
},
{
"label": "publish-pablodraw",
"command": "dotnet",
"type": "shell",
"args": [
"publish",
"${workspaceFolder}/Source/PabloDraw/PabloDraw.csproj",
// "/p:BuildTarget=Linux",
"/p:Configuration=Release",
"/p:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"group": "build",
"presentation": {
"clear": true
},
"problemMatcher": "$msCompile"
},
{
"label": "run-published",
"type": "shell",
"osx": {
"command": "${workspaceFolder}/artifacts/bin/Release/net5.0/osx-x64/PabloDraw.app/Contents/MacOS/PabloDraw",
},
"windows": {
"command": "${workspaceFolder}/artifacts/bin/Release/net5.0-windows/win-x64/publish/PabloDraw.exe",
},
"linux": {
"command": "${workspaceFolder}/artifacts/bin/Release/net5.0/linux-x64/publish/PabloDraw",
},
"problemMatcher": [ ]
}
]
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Curtis Wensley
Copyright (c) 2021 Curtis Wensley

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 0 additions & 1 deletion Libraries/Mono.Nat
Submodule Mono.Nat deleted from b20141
82 changes: 0 additions & 82 deletions Libraries/extractprojects.sh

This file was deleted.

1 change: 0 additions & 1 deletion Libraries/lidgren
Submodule lidgren deleted from da7b4b
9 changes: 7 additions & 2 deletions Source/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Company>Picoe Software Solutions</Company>
<Copyright>(c) 2006-2019 by Curtis Wensley aka Eto</Copyright>
<Copyright>(c) 2006-2021 by Curtis Wensley aka Eto</Copyright>
<Version>3.3.0-dev</Version>

<BasePath>$(MSBuildThisFileDirectory)..\</BasePath>
<ArtifactsDir>$(BasePath)Artifacts\</ArtifactsDir>
<ArtifactsDir>$(BasePath)artifacts\</ArtifactsDir>

<DebugType>embedded</DebugType>

<BaseIntermediateOutputPath Condition="$(BaseIntermediateOutputPath) == ''">$(ArtifactsDir)obj\$(OS)\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
<OutputArtifactName Condition="$(OutputArtifactName) == ''">bin</OutputArtifactName>
<BaseOutputPath Condition="$(BaseOutputPath) == ''">$(ArtifactsDir)$(OutputArtifactName)\</BaseOutputPath>
<PackageOutputPath Condition="$(PackageOutputPath) == ''">$(ArtifactsDir)nuget\$(Configuration)\</PackageOutputPath>
<RestoreProjectStyle Condition="'$(RestoreProjectStyle)' == ''">PackageReference</RestoreProjectStyle>

<!-- Uncomment to use Eto from source -->
<!-- <EtoBasePath>..\..\..\Eto\</EtoBasePath> -->

</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion Source/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<Import Project="EmbedReferences.targets" />

<UsingTask TaskName="_ParseVersion" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<UsingTask TaskName="_ParseVersion" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<Version ParameterType="System.String" Required="true" />
<AssemblyVersion ParameterType="System.String" Output="true" />
Expand Down
Loading

0 comments on commit 8357c92

Please sign in to comment.