Skip to content

Commit

Permalink
Trigger release when making GitHub release
Browse files Browse the repository at this point in the history
Figure out version number automatically from release tag.
  • Loading branch information
zvonimir committed Jul 8, 2021
1 parent 8a66b52 commit fa85ed6
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 9 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Corral Release

on:
release:
types: [published]

env:
SOLUTION: source/Corral.sln

jobs:
job0:
name: Corral Release
runs-on: ubuntu-20.04
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Checkout Corral
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build Corral, package Corral
run: |
# Find version from tag info
VERSION="${GITHUB_REF##*/v}"
echo VERSION=$VERSION
# Change directory to Corral root folder
cd $GITHUB_WORKSPACE
# Restore dotnet tools
dotnet tool restore
# Build Corral
dotnet build -c Release ${SOLUTION}
# Create packages
dotnet pack -p:PackageVersion=$VERSION --no-build -c Release ${SOLUTION}
- name: Deploy to nuget
run:
dotnet nuget push "source/Corral/bin/Release/Corral*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
10 changes: 2 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Corral CI
on:
workflow_dispatch:
push:
tags:
- 'v*'
branches:
- master
pull_request:
branches:
- master
Expand Down Expand Up @@ -41,12 +41,6 @@ jobs:
dotnet tool restore
# Build Corral
dotnet build -c ${{ matrix.configuration }} ${SOLUTION}
# Create packages
dotnet pack --no-build -c ${{ matrix.configuration }} ${SOLUTION}
# Run regression tests
export CONFIGURATION=${{ matrix.configuration }}
(cd test/regression && perl check.pl)
- name: Deploy to nuget
if: matrix.configuration == 'Release' && startsWith(github.ref, 'refs/tags/v')
run: |
dotnet nuget push "source/Corral/bin/${{ matrix.configuration }}/Corral*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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


Corral is a solver for the reachability modulo theories problem. Learn more
Expand Down
1 change: 0 additions & 1 deletion source/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<!-- Target framework and package configuration -->
<PropertyGroup>
<Version>1.1.4</Version>
<TargetFramework>net5.0</TargetFramework>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Authors>Corral</Authors>
Expand Down

0 comments on commit fa85ed6

Please sign in to comment.