From b08d24ffd044a8b632b02dc6b8930b1a0bfb0df9 Mon Sep 17 00:00:00 2001 From: rvost Date: Fri, 15 Sep 2023 17:53:38 +0300 Subject: [PATCH] ci: Add workflow for publishing to GPR - Add workflow for publishing packages to GPR; - Temporarily disable the dotnet workflow from running on every push. --- .github/workflows/dotnet.yml | 1 - .github/workflows/publish.yml | 42 ++++++++++++++++++++++++++++ BIS.Signatures/BIS.Signatures.csproj | 2 +- BIS.WRP/BIS.WRP.csproj | 2 +- 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 80fe861..6df3930 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -1,7 +1,6 @@ name: dotnet on: - push: pull_request: jobs: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..11199a2 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 diff --git a/BIS.Signatures/BIS.Signatures.csproj b/BIS.Signatures/BIS.Signatures.csproj index 2b84f97..e02acf7 100644 --- a/BIS.Signatures/BIS.Signatures.csproj +++ b/BIS.Signatures/BIS.Signatures.csproj @@ -4,7 +4,7 @@ netstandard2.0 11.0 true - BIS.Formats.Core + BIS.Formats.Signatures rvost MIT https://github.com/rvost/bis-file-formats diff --git a/BIS.WRP/BIS.WRP.csproj b/BIS.WRP/BIS.WRP.csproj index e272f8d..75da3cd 100644 --- a/BIS.WRP/BIS.WRP.csproj +++ b/BIS.WRP/BIS.WRP.csproj @@ -3,7 +3,7 @@ netstandard2.0 true - BIS.Formats.Core + BIS.Formats.WRP Braini01, GrueArbre LICENSE https://github.com/rvost/bis-file-formats