Skip to content

Commit

Permalink
Merge pull request #173 from microsoft/master
Browse files Browse the repository at this point in the history
Create new release including "alpha" Linux support
  • Loading branch information
mjcheetham authored Sep 22, 2020
2 parents 819e6bc + 221fe61 commit a87e1e5
Show file tree
Hide file tree
Showing 105 changed files with 5,508 additions and 2,605 deletions.
8 changes: 8 additions & 0 deletions .azure-pipelines/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@ jobs:
steps:
- template: templates/osx/compile.yml
- template: templates/osx/pack.unsigned.yml

- job: ubuntu1804_x86_64
displayName: Ubuntu 18.04 LTS x86_64
pool:
vmImage: ubuntu-18.04
steps:
- template: templates/linux/compile.yml
- template: templates/linux/pack.unsigned.yml
13 changes: 11 additions & 2 deletions .azure-pipelines/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
trigger: none

pr:
- master
- release

variables:
configuration: Release
Expand All @@ -22,3 +23,11 @@ jobs:
steps:
- template: templates/osx/compile.yml
- template: templates/osx/pack.unsigned.yml

- job: ubuntu1804_x86_64
displayName: Ubuntu 18.04 LTS x86_64
pool:
vmImage: ubuntu-18.04
steps:
- template: templates/linux/compile.yml
- template: templates/linux/pack.unsigned.yml
8 changes: 8 additions & 0 deletions .azure-pipelines/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,11 @@ jobs:
vmImage: $(osxImage)
steps:
- template: templates/osx/pack.signed/step5-dist.yml

- job: ubuntu1804_x86_64
displayName: Ubuntu 18.04 LTS x86_64
pool:
vmImage: ubuntu-18.04
steps:
- template: templates/linux/compile.yml
- template: templates/linux/pack.unsigned.yml
22 changes: 22 additions & 0 deletions .azure-pipelines/templates/linux/compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
steps:
- task: UseDotNet@2
displayName: Use .NET Core SDK 3.1.x
inputs:
packageType: sdk
version: 3.1.x

- task: DotNetCoreCLI@2
displayName: Compile common code
inputs:
command: build
projects: 'Git-Credential-Manager.sln'
arguments: '--configuration=Linux$(configuration)'

- task: DotNetCoreCLI@2
displayName: Run common unit tests
inputs:
command: test
projects: 'Git-Credential-Manager.sln'
arguments: '--configuration=Linux$(configuration)'
publishTestResults: true
testRunTitle: 'Unit tests (Linux)'
12 changes: 12 additions & 0 deletions .azure-pipelines/templates/linux/pack.unsigned.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
steps:
- script: |
mkdir -p "$(Build.StagingDirectory)/publish/"
cp "out/linux/Packaging.Linux/tar/$(configuration)/"*.tar.gz "$(Build.StagingDirectory)/publish/"
cp "out/linux/Packaging.Linux/deb/$(configuration)/"*.deb "$(Build.StagingDirectory)/publish/"
displayName: Prepare final build artifacts
- task: PublishPipelineArtifact@0
displayName: Publish unsigned installer artifacts
inputs:
artifactName: 'Installer.Linux.Unsigned'
targetPath: '$(Build.StagingDirectory)/publish'
36 changes: 36 additions & 0 deletions .github/workflows/build-installers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build-Installers

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
linux:
name: "Linux"

runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Indicate full history so Nerdbank.GitVersioning works.

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.302

- name: Install dependencies
run: dotnet restore --force

- name: Build Linux Payloads
run: dotnet build -c Release src/linux/Packaging.Linux/Packaging.Linux.csproj

- name: Upload Installers
uses: actions/upload-artifact@v2
with:
name: Installers
path: |
out/linux/Packaging.Linux/deb/Release/*.deb
out/linux/Packaging.Linux/tar/Release/*.tar.gz
44 changes: 44 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: GCM-Core

on:
push:
branches: [ master, linux ]
pull_request:
branches: [ master, linux ]

jobs:
validate_gcm:
name: "CI"

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, windows-2019, macos-10.15]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Indicate full history so Nerdbank.GitVersioning works.

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.302

- name: Install dependencies
run: dotnet restore

- name: Build Windows
if: contains(matrix.os, 'windows')
run: dotnet build --configuration WindowsRelease

- name: Build Linux
if: contains(matrix.os, 'ubuntu')
run: dotnet build --configuration LinuxRelease

- name: Build macOS
if: contains(matrix.os, 'macos')
run: dotnet build --configuration MacRelease

- name: Test
run: dotnet test --no-restore --verbosity normal
30 changes: 4 additions & 26 deletions .github/workflows/release-homebrew.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,18 @@
name: "release-homebrew"
on:
release:
types: [published]
types: [released]

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Get macOS package version
uses: actions/github-script@0.3.0
id: version
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: |
const { data: releases } = await github.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo
});
const release = releases.find(x => x.tag_name === process.env.GITHUB_REF);
if (!release) {
throw new Error(`unable to find release with tag '${process.env.GITHUB_REF}'`);
}
const regex = /gcmcore-osx-(.*)\.pkg/;
const asset = release.assets.find(x => regex.test(x.name));
if (!asset) {
throw new Error(`unable to find asset matching '${regex}'`);
}
const matches = asset.name.match(regex);
const version = matches[1];
return version;
- name: Update Homebrew tap
uses: mjcheetham/update-homebrew@v1
uses: mjcheetham/update-homebrew@v1.1
with:
token: ${{ secrets.HOMEBREW_TOKEN }}
tap: microsoft/git
name: git-credential-manager-core
type: cask
version: ${{ steps.version.outputs.result }}
releaseAsset: gcmcore-osx-(.*)\.pkg
alwaysUsePullRequest: true
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PropertyGroup>
<!--
Set helpful property for detecting the current OS platform.
We can't use the build-in $(OS) because it returns 'Unix' on macOS when run under Mono.
We can't use the built-in $(OS) because it returns 'Unix' on macOS when run under Mono.
-->
<OSPlatform Condition="$([MSBuild]::IsOsPlatform('windows'))">windows</OSPlatform>
<OSPlatform Condition="$([MSBuild]::IsOsPlatform('osx'))">osx</OSPlatform>
Expand All @@ -23,7 +23,7 @@
<ItemGroup>
<!-- All projects should use Nerdbank.GitVersioning for consistent version numbers -->
<PackageReference Include="Nerdbank.GitVersioning">
<Version>2.3.38</Version>
<Version>3.2.7-beta</Version>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
Loading

0 comments on commit a87e1e5

Please sign in to comment.