Skip to content

Commit 6805e27

Browse files
committed
Move CI from AppVeyor to GitHub Actions and publish to NuGet on tag
1 parent 78bf604 commit 6805e27

4 files changed

Lines changed: 92 additions & 26 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: ['*']
7+
pull_request:
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: build-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
env:
15+
DOTNET_CLI_TELEMETRY_OPTOUT: true
16+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
17+
DOTNET_NOLOGO: true
18+
19+
jobs:
20+
build:
21+
runs-on: windows-latest
22+
timeout-minutes: 30
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Set up .NET
28+
uses: actions/setup-dotnet@v4
29+
with:
30+
global-json-file: global.json
31+
32+
# The tag is the version: tag 1.2.3 (or v1.2.3) builds 1.2.3. Other builds use the
33+
# Version in Directory.Build.props.
34+
- name: Resolve the version from the tag
35+
if: startsWith(github.ref, 'refs/tags/')
36+
shell: bash
37+
run: echo "VERSION_ARGUMENT=-p:Version=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
38+
39+
- name: Build
40+
run: dotnet build src --configuration Release ${{ env.VERSION_ARGUMENT }}
41+
42+
- name: Test
43+
run: dotnet test src --configuration Release --no-build --no-restore
44+
45+
- name: Upload received on failure
46+
if: failure()
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: received
50+
path: '**/*.received.*'
51+
if-no-files-found: ignore
52+
retention-days: 14
53+
54+
- name: Upload packages
55+
if: success()
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: nupkgs
59+
path: nugets/**/*.nupkg
60+
if-no-files-found: warn
61+
retention-days: 30
62+
63+
# Trusted publishing: no stored API key. nuget.org validates GitHub's OIDC token against the
64+
# policy naming this repository and this workflow file, and returns a key good for an hour.
65+
publish:
66+
needs: build
67+
if: startsWith(github.ref, 'refs/tags/')
68+
runs-on: ubuntu-latest
69+
timeout-minutes: 10
70+
permissions:
71+
contents: read
72+
id-token: write
73+
steps:
74+
- name: Download packages
75+
uses: actions/download-artifact@v4
76+
with:
77+
name: nupkgs
78+
path: packages
79+
80+
- name: NuGet login
81+
id: login
82+
uses: NuGet/login@v1
83+
with:
84+
user: SimonCropp
85+
86+
- name: Push to nuget.org
87+
run: >
88+
dotnet nuget push "packages/**/*.nupkg"
89+
--api-key ${{ steps.login.outputs.NUGET_API_KEY }}
90+
--source https://api.nuget.org/v3/index.json
91+
--skip-duplicate

‎readme.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# <img src="/src/icon.png" height="30px"> Verify.TestableIO.System.IO.Abstractions
22

33
[![Discussions](https://img.shields.io/badge/Verify-Discussions-yellow?svg=true&label=)](https://github.com/orgs/VerifyTests/discussions)
4-
[![Build status](https://ci.appveyor.com/api/projects/status/8i6xgngkisbxxye6?svg=true)](https://ci.appveyor.com/project/SimonCropp/verify-testableio-system-io-abstractions)
4+
[![Build status](https://github.com/VerifyTests/Verify.TestableIO.System.IO.Abstractions/actions/workflows/build.yml/badge.svg)](https://github.com/VerifyTests/Verify.TestableIO.System.IO.Abstractions/actions/workflows/build.yml)
55
[![NuGet Status](https://img.shields.io/nuget/v/Verify.TestableIO.System.IO.Abstractions.svg)](https://www.nuget.org/packages/Verify.TestableIO.System.IO.Abstractions/)
66

77
Extends [Verify](https://github.com/VerifyTests/Verify) to allow verification of [TestableIO.System.IO.Abstractions](https://github.com/TestableIO/System.IO.Abstractions) bits.<!-- singleLineInclude: intro. path: /docs/intro.include.md -->

‎src/Verify.TestableIO.System.IO.Abstractions.slnx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<File Path="../readme.md" />
66
<File Path="../.editorconfig" />
77
<File Path="../.gitattributes" />
8-
<File Path="appveyor.yml" />
98
<File Path="Directory.Build.props" />
109
<File Path="Directory.Packages.props" />
1110
<File Path="../global.json" />

‎src/appveyor.yml‎

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)