Skip to content

Commit

Permalink
Merge branch 'release/1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiringWorm committed Mar 26, 2021
2 parents 7cf06d6 + a2985b5 commit 24d5bb1
Show file tree
Hide file tree
Showing 32 changed files with 333 additions and 207 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
- "release/**"
- "hotfix/**"
- "feature/**"
tags:
- "*"
paths-ignore:
- "README.md"
pull_request:
Expand All @@ -17,7 +19,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
os: [windows-2019, ubuntu-18.04, macos-10.15]
env:
AZURE_PASSWORD: ${{ secrets.AZURE_PASSWORD }}
AZURE_SOURCE: ${{ secrets.AZURE_SOURCE }}
Expand All @@ -37,18 +39,19 @@ jobs:

steps:
- uses: actions/checkout@v2.3.4
with:
sumbodules: true
- name: Fetch all tags and branches
run: git fetch --prune --unshallow
- name: Install Transifex Client
if: ${{ runner.os == 'ubuntu-latest' }} # We do not need it for anything else
if: ${{ matrix.os == 'ubuntu-18.04' }} # We do not need it for anything else
run: sudo apt-get install transifex-client -y
- name: Cache Tools
uses: actions/cache@v2.1.4
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
- name: Remove local nuget
if: ${{ runner.os == 'Linux' }}
run: sudo rm /usr/bin/nuget
- name: Build Addin
uses: cake-build/cake-action@v1
with:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ on:
jobs:
super_linter:
name: List with Super Linter
runs-on: ubuntu-latest
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2.3.4
with:
fetch-depth: 0

- name: Lint Code Base
uses: github/super-linter@v3.14.5
uses: github/super-linter@v3.15.5
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: develop
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pre-release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
draft-pre-release:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
runs-on: ubuntu-latest
runs-on: ubuntu-18.04

steps:
- name: Checkout the requested branch
Expand All @@ -21,13 +21,13 @@ jobs:
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
- name: Set up git version
if: ${{ !contains(github.ref, '/hotfix/') && !contains(github.ref, '/release/') }}
uses: gittools/actions/gitversion/setup@v0.9.4
uses: gittools/actions/gitversion/setup@v0.9.9
with:
versionSpec: "5.x"
- name: Run git version
if: ${{ !contains(github.ref, '/hotfix/') && !contains(github.ref, '/release/') }}
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.4
uses: gittools/actions/gitversion/execute@v0.9.9
- name: Create release branch ${{ github.event.inputs.version }}
if: ${{ steps.gitversion.outputs.majorMinorPatch }}
run: git switch -c release/${{ steps.gitversion.outputs.majorMinorPatch }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publishdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
WYAM_ACCESS_TOKEN: ${{ secrets.WYAM_ACCESS_TOKEN }}
WYAM_DEPLOY_REMOTE: "${{ github.event.repository.html_url }}"
WYAM_DEPLOY_BRANCH: "gh-pages"
runs-on: ubuntu-latest
runs-on: ubuntu-18.04

steps:
- name: Checkout the requested branch
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
draft-stable:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
runs-on: ubuntu-latest
runs-on: ubuntu-18.04

steps:
- name: Checkout the requested branch
Expand All @@ -21,13 +21,13 @@ jobs:
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
- name: Set up git version
if: ${{ !contains(github.ref, '/hotfix/') && !contains(github.ref, '/release/') }}
uses: gittools/actions/gitversion/setup@v0.9.4
uses: gittools/actions/gitversion/setup@v0.9.9
with:
versionSpec: "5.x"
- name: Run git version
if: ${{ !contains(github.ref, '/hotfix/') && !contains(github.ref, '/release/') }}
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.4
uses: gittools/actions/gitversion/execute@v0.9.9
- name: Create release branch ${{ github.event.inputs.version }}
if: ${{ steps.gitversion.outputs.majorMinorPatch }}
run: git switch -c release/${{ steps.gitversion.outputs.majorMinorPatch }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- develop
pull_request:

jobs:
toc:
Expand Down
2 changes: 1 addition & 1 deletion GitReleaseManager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ close:
- [GitHub release](https://github.com/{owner}/{repository}/releases/tag/{milestone})
- [NuGet.org](https://nuget.org/packages/{repository}/{milestone})
- Within Cake script: `#addin "nuget:?package={repository}&version={milestone}"
- Within Cake script: `#addin "nuget:?package={repository}&version={milestone}"`
Your friendly **[GitReleaseManager](https://github.com/GitTools/GitReleaseManager)** bot :package::rocket:
issue-labels-include:
Expand Down
26 changes: 11 additions & 15 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
$ErrorActionPreference = 'Stop'
$ErrorActionPreference = 'Stop'

function Run([string[]]$arguments) {
$proc = Start-Process "dotnet" $arguments -PassThru -NoNewWindow
Wait-Process -InputObject $proc
Set-Location -LiteralPath $PSScriptRoot

if ($proc.ExitCode -ne 0) {
"Non-Zero exit code ($($proc.ExitCode)), exiting..."
exit $proc.ExitCode
}
}
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = '1'
$env:DOTNET_CLI_TELEMETRY_OPTOUT = '1'
$env:DOTNET_NOLOGO = '1'

Run tool, restore
dotnet tool restore
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

Run cake, recipe.cake, --bootstrap
dotnet cake recipe.cake --bootstrap
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

$arguments = @("cake"; "recipe.cake")
$arguments += @($args)

Run $arguments
dotnet cake recipe.cake @args
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
10 changes: 9 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/bash
#!/usr/bin/env bash
set -euox pipefail

cd "$(dirname "${BASH_SOURCE[0]}")"

export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_NOLOGO=1

dotnet tool restore

dotnet cake recipe.cake --bootstrap
Expand Down
4 changes: 3 additions & 1 deletion recipe.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#load nuget:?package=Cake.Recipe&version=2.1.0
#load nuget:?package=Cake.Recipe&version=2.2.1
#load "./.build/*.cake"
Environment.SetVariableNames();
Expand All @@ -14,6 +14,8 @@ BuildParameters.SetParameters(
shouldRunDotNetCorePack: true,
solutionFilePath: "./Cake.Transifex.sln",
testFilePattern: "/**/*.Tests.csproj",
preferredBuildAgentOperatingSystem: PlatformFamily.Linux,
preferredBuildProviderType: BuildProviderType.GitHubActions,
shouldRunCodecov: true,
shouldRunCoveralls: false,
shouldUseDeterministicBuilds: true,
Expand Down
10 changes: 5 additions & 5 deletions src/Cake.Transifex.Tests/Cake.Transifex.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net50;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net5.0;netcoreapp2.1</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="Moq" Version="4.16.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.1" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="Shouldly" Version="4.0.3" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Include="Cake.Testing" Version="1.0.0" />
<PackageReference Include="coverlet.msbuild" Version="3.0.2">
<PackageReference Include="Cake.Testing" Version="1.1.0" />
<PackageReference Include="coverlet.msbuild" Version="3.0.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
28 changes: 14 additions & 14 deletions src/Cake.Transifex.Tests/TransifexInitRunnerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ namespace Cake.Transifex.Tests

public class TransifexInitRunnerTests
{
private readonly TransifexInitFixture fixture;
private readonly TransifexInitFixture _fixture;

public TransifexInitRunnerTests()
{
this.fixture = new TransifexInitFixture();
_fixture = new TransifexInitFixture();
}

[Theory]
[InlineData(null)]
[InlineData("")]
public void Evaluate_DoesNotSetHostWhenNullOrEmpty(string host)
{
this.fixture.Settings = new TransifexInitSettings { Host = host };
_fixture.Settings = new TransifexInitSettings { Host = host };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("init");
}
Expand All @@ -34,19 +34,19 @@ public void Evaluate_DoesNotSetHostWhenNullOrEmpty(string host)
[InlineData("", "SECRET-PASSWORD")]
public void Evaluate_DoesNotSetUserNameAndPasswordWhenEitherIsEmpty(string userName, string password)
{
this.fixture.Settings = new TransifexInitSettings { Username = userName, Password = password };
_fixture.Settings = new TransifexInitSettings { Username = userName, Password = password };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("init --host www.transifex.com");
}

[Fact]
public void Evaluate_SetHostByDefault()
{
this.fixture.Settings = null;
_fixture.Settings = null;

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("init --host www.transifex.com");
}
Expand All @@ -55,9 +55,9 @@ public void Evaluate_SetHostByDefault()
public void Evaluate_SetsTokenWhenOneIsSpecified()
{
const string token = "MY-AWESOME-TOKEN";
this.fixture.Settings = new TransifexInitSettings { Token = token };
_fixture.Settings = new TransifexInitSettings { Token = token };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("init --host www.transifex.com --token " + token);
}
Expand All @@ -67,9 +67,9 @@ public void Evaluate_SetsUserNameAndPassword()
{
const string userName = "My-Awesome-Username";
const string password = "My-Super-Awesome-Secret-Password";
this.fixture.Settings = new TransifexInitSettings { Username = userName, Password = password };
_fixture.Settings = new TransifexInitSettings { Username = userName, Password = password };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe($"init --host www.transifex.com --user {userName} --pass {password}");
}
Expand All @@ -82,9 +82,9 @@ public void Evaluate_SetsUserNameAndPassword()
[InlineData("token", "userName", "password")]
public void Evaluate_ThrowsArgumentExceptionWhenTokenAndUsernameOrPasswordIsSpecified(string token, string userName, string password)
{
this.fixture.Settings = new TransifexInitSettings { Token = token, Username = userName, Password = password };
_fixture.Settings = new TransifexInitSettings { Token = token, Username = userName, Password = password };

var ex = Assert.Throws<ArgumentException>(() => this.fixture.Run());
var ex = Assert.Throws<ArgumentException>(() => _fixture.Run());

Assert.Equal(Exceptions.TokenAndUsernameException, ex.Message);
}
Expand Down
Loading

0 comments on commit 24d5bb1

Please sign in to comment.