Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up GitHub Actions release workflow #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: release

on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+

jobs:
release:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Extract TaxJar Version
run: echo ::set-env name=TAXJAR_VERSION::$(echo ${GITHUB_REF:11})
- name: Build release DLL for .NET Standard 2.0
run: |
sed -i 's/^\(\s*\)<TargetFrameworks>.*$/\1<TargetFrameworks>netstandard2.0<\/TargetFrameworks>/' src/Taxjar/Taxjar.csproj
dotnet restore src/Taxjar/Taxjar.csproj
msbuild src/Taxjar/Taxjar.csproj /p:configuration=Release
cp src/Taxjar/bin/Release/netstandard2.0/TaxJar.dll build/netstandard2.0
- name: Build release DLL for .NET 4.5.2
run: |
sed -i 's/^\(\s*\)<TargetFrameworks>.*$/\1<TargetFrameworks>net452<\/TargetFrameworks>/' src/Taxjar/Taxjar.csproj
dotnet restore src/Taxjar/Taxjar.csproj
msbuild src/Taxjar/Taxjar.csproj /p:configuration=Release /p:targetframework=net452
cp src/Taxjar/bin/Release/net452/TaxJar.dll build/net452
- name: Create NuGet package
run: |
sed -i 's/^\(\s*\)<TargetFrameworks>.*$/\1<TargetFrameworks>netstandard2.0;net452<\/TargetFrameworks>/' src/Taxjar/Taxjar.csproj
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this line is necessary, but it's included in our current release procedures.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure what this is. Is this maybe adding the multi-targeting line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codymullins Exactly. It's just resetting src/Taxjar/Taxjar.csproj to <TargetFrameworks>netstandard2.0;net456</TargetFrameworks>. I just wasn't sure that's strictly necessary before running the next step: mono build/nuget.exe pack build/TaxJar.nuspec.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine.

mono build/nuget.exe pack build/TaxJar.nuspec
- name: Publish NuGet package
run: mono build/nuget.exe push TaxJar.$TAXJAR_VERSION.nupkg ${{ secrets.NUGET_API_TOKEN }} -Source https://www.nuget.org/api/v2/package
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fastdivision To make this work, you'll need to add our API token for NuGet here: https://github.com/taxjar/taxjar.net/settings/secrets