Skip to content

Commit fa85ed6

Browse files
committed
Trigger release when making GitHub release
Figure out version number automatically from release tag.
1 parent 8a66b52 commit fa85ed6

File tree

4 files changed

+41
-9
lines changed

4 files changed

+41
-9
lines changed

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Corral Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
SOLUTION: source/Corral.sln
9+
10+
jobs:
11+
job0:
12+
name: Corral Release
13+
runs-on: ubuntu-20.04
14+
steps:
15+
- name: Setup dotnet
16+
uses: actions/setup-dotnet@v1
17+
with:
18+
dotnet-version: '5.0.x'
19+
- name: Checkout Corral
20+
uses: actions/checkout@v2
21+
with:
22+
fetch-depth: 0
23+
- name: Build Corral, package Corral
24+
run: |
25+
# Find version from tag info
26+
VERSION="${GITHUB_REF##*/v}"
27+
echo VERSION=$VERSION
28+
# Change directory to Corral root folder
29+
cd $GITHUB_WORKSPACE
30+
# Restore dotnet tools
31+
dotnet tool restore
32+
# Build Corral
33+
dotnet build -c Release ${SOLUTION}
34+
# Create packages
35+
dotnet pack -p:PackageVersion=$VERSION --no-build -c Release ${SOLUTION}
36+
- name: Deploy to nuget
37+
run:
38+
dotnet nuget push "source/Corral/bin/Release/Corral*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json

.github/workflows/test.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: Corral CI
33
on:
44
workflow_dispatch:
55
push:
6-
tags:
7-
- 'v*'
6+
branches:
7+
- master
88
pull_request:
99
branches:
1010
- master
@@ -41,12 +41,6 @@ jobs:
4141
dotnet tool restore
4242
# Build Corral
4343
dotnet build -c ${{ matrix.configuration }} ${SOLUTION}
44-
# Create packages
45-
dotnet pack --no-build -c ${{ matrix.configuration }} ${SOLUTION}
4644
# Run regression tests
4745
export CONFIGURATION=${{ matrix.configuration }}
4846
(cd test/regression && perl check.pl)
49-
- name: Deploy to nuget
50-
if: matrix.configuration == 'Release' && startsWith(github.ref, 'refs/tags/v')
51-
run: |
52-
dotnet nuget push "source/Corral/bin/${{ matrix.configuration }}/Corral*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![License][license-badge]](LICENSE.txt)
44
[![NuGet package][nuget-badge]][nuget]
5+
[![Corral CI](https://github.com/boogie-org/corral/actions/workflows/test.yml/badge.svg)](https://github.com/boogie-org/corral/actions/workflows/test.yml)
56

67

78
Corral is a solver for the reachability modulo theories problem. Learn more

source/Directory.Build.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
<!-- Target framework and package configuration -->
44
<PropertyGroup>
5-
<Version>1.1.4</Version>
65
<TargetFramework>net5.0</TargetFramework>
76
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
87
<Authors>Corral</Authors>

0 commit comments

Comments
 (0)