Skip to content

Commit

Permalink
ci: Add workflow for publishing to GPR
Browse files Browse the repository at this point in the history
- Add workflow for publishing packages to GPR;
- Temporarily disable the dotnet workflow from running on every push.
  • Loading branch information
rvost committed Nov 20, 2023
1 parent abe8ee9 commit b08d24f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: dotnet

on:
push:
pull_request:

jobs:
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish

on:
push:
tags:
- "*.*.*"



env:
PROJECT_PATH: bis-file-formats.sln

jobs:
publish:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x

- name: Restore
run: dotnet restore ${{ env.PROJECT_PATH }}

- name: Build
run: |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
dotnet build ${{ env.PROJECT_PATH }} -c Release -o "publish" --no-restore -p:PackageVersion=$VERSION
- name: Add source
run: dotnet nuget add source --username rvost --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/rvost/index.json"

- name: Puplish packages
run: dotnet nuget push "publish/*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source "github" --skip-duplicate
2 changes: 1 addition & 1 deletion BIS.Signatures/BIS.Signatures.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>11.0</LangVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>BIS.Formats.Core</PackageId>
<PackageId>BIS.Formats.Signatures</PackageId>
<Authors>rvost</Authors>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/rvost/bis-file-formats</RepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion BIS.WRP/BIS.WRP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>BIS.Formats.Core</PackageId>
<PackageId>BIS.Formats.WRP</PackageId>
<Authors>Braini01, GrueArbre</Authors>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<RepositoryUrl>https://github.com/rvost/bis-file-formats</RepositoryUrl>
Expand Down

0 comments on commit b08d24f

Please sign in to comment.