From 129a303d7db91f30eacd16194054e926ad5ba9a9 Mon Sep 17 00:00:00 2001 From: John Jeffers Date: Thu, 6 Jun 2024 17:31:36 -0600 Subject: [PATCH 1/4] add deploy workflow --- .github/workflows/deploy.yaml | 96 +++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 00000000..d949ee47 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,96 @@ +# Run locally with act: +# +# act pull_request [--input command=[command]] \ +# --platform fusionauth-builder=[ecr-repo-name]/fusionauth-builder:latest] \ +# --workflows ./.github/workflows/release.yaml \ +# --env-file <(aws configure export-credentials --profile [aws-profile] --format env) + +name: Deploy + +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + inputs: + command: + type: choice + options: + - build # build only + - publish # build & publish to rubygems + - release # build & release to svn + default: build + +permissions: + contents: read + +jobs: + build: + if: | + github.event_name == 'pull_request' || + github.event_name == 'push' || + github.event_name == 'workflow_dispatch' && inputs.command == 'build' + runs-on: fusionauth-builder + steps: + - name: checkout + uses: actions/checkout@v4 + + # Install openssl 1.1 because openssl 3.x is not supported by dotnet 5 + - name: install openssl 1.1 + run: | + wget http://ports.ubuntu.com/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_arm64.deb + dpkg -i libssl1.1_1.1.1f-1ubuntu2_arm64.deb + + - name: compile + shell: bash -l {0} + run: sb compile + + deploy: + if: | + github.event_name == 'workflow_dispatch' && + (inputs.command == 'release' || inputs.command == 'publish') + runs-on: fusionauth-builder + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: set aws credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::752443094709:role/github-actions + role-session-name: aws-auth-action + aws-region: us-west-2 + + - name: get secret + run: | + while IFS=$'\t' read -r key value; do + echo "::add-mask::${value}" + echo "${key}=${value}" >> $GITHUB_ENV + done < <(aws secretsmanager get-secret-value \ + --region us-west-2 \ + --secret-id platform/nuget \ + --query SecretString \ + --output text | \ + jq -r 'to_entries[] | [.key, .value] | @tsv') + + # Install openssl 1.1 because openssl 3.x is not supported by dotnet 5 :sad-trombone: + - name: install openssl 1.1 + run: | + wget http://ports.ubuntu.com/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_arm64.deb + dpkg -i libssl1.1_1.1.1f-1ubuntu2_arm64.deb + + - name: update savant properties file + run: echo "nugetAPIKey=${{ env.API_KEY }}" >> ~/.savant/config.properties + + - name: release to svn + if: inputs.command == 'release' + shell: bash -l {0} + run: sb release + + - name: publish to nuget + if: inputs.command == 'publish' + shell: bash -l {0} + run: sb publish From e4c96f19b654129743e0a2e309eed22812cc9f6c Mon Sep 17 00:00:00 2001 From: John Jeffers Date: Thu, 6 Jun 2024 22:13:12 -0600 Subject: [PATCH 2/4] remove openssl hack because we're building with dotnet 8 now --- .github/workflows/deploy.yaml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index d949ee47..2fb7ac6c 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -38,12 +38,6 @@ jobs: - name: checkout uses: actions/checkout@v4 - # Install openssl 1.1 because openssl 3.x is not supported by dotnet 5 - - name: install openssl 1.1 - run: | - wget http://ports.ubuntu.com/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_arm64.deb - dpkg -i libssl1.1_1.1.1f-1ubuntu2_arm64.deb - - name: compile shell: bash -l {0} run: sb compile @@ -76,12 +70,6 @@ jobs: --output text | \ jq -r 'to_entries[] | [.key, .value] | @tsv') - # Install openssl 1.1 because openssl 3.x is not supported by dotnet 5 :sad-trombone: - - name: install openssl 1.1 - run: | - wget http://ports.ubuntu.com/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_arm64.deb - dpkg -i libssl1.1_1.1.1f-1ubuntu2_arm64.deb - - name: update savant properties file run: echo "nugetAPIKey=${{ env.API_KEY }}" >> ~/.savant/config.properties From d3e85b9dbcb8d344681b7119e8040229ee0602fb Mon Sep 17 00:00:00 2001 From: John Jeffers Date: Thu, 6 Jun 2024 22:30:11 -0600 Subject: [PATCH 3/4] bump targets and dependencies to fix vulnerabilities --- .github/workflows/deploy.yaml | 2 +- fusionauth-netcore-client/fusionauth-netcore-client.csproj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 2fb7ac6c..8d0c9619 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -20,7 +20,7 @@ on: type: choice options: - build # build only - - publish # build & publish to rubygems + - publish # build & publish to nuget - release # build & release to svn default: build diff --git a/fusionauth-netcore-client/fusionauth-netcore-client.csproj b/fusionauth-netcore-client/fusionauth-netcore-client.csproj index c7917d31..9d968ace 100644 --- a/fusionauth-netcore-client/fusionauth-netcore-client.csproj +++ b/fusionauth-netcore-client/fusionauth-netcore-client.csproj @@ -12,12 +12,12 @@ FusionAuth FusionAuth client for .NET Core 7.3 - netstandard2.0;netstandard2.1;netcoreapp2.1;netcoreapp3.1 + netstandard2.0;netstandard2.1;netcoreapp2.2;netcoreapp3.1 FusionAuth - + From 7c7e2f13dde3a51c140b827e89c9acaf95b33372 Mon Sep 17 00:00:00 2001 From: John Jeffers Date: Fri, 7 Jun 2024 12:29:08 -0600 Subject: [PATCH 4/4] add net6 and net8 targets --- fusionauth-netcore-client/fusionauth-netcore-client.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fusionauth-netcore-client/fusionauth-netcore-client.csproj b/fusionauth-netcore-client/fusionauth-netcore-client.csproj index 9d968ace..3e6b1e77 100644 --- a/fusionauth-netcore-client/fusionauth-netcore-client.csproj +++ b/fusionauth-netcore-client/fusionauth-netcore-client.csproj @@ -12,7 +12,7 @@ FusionAuth FusionAuth client for .NET Core 7.3 - netstandard2.0;netstandard2.1;netcoreapp2.2;netcoreapp3.1 + netstandard2.0;netstandard2.1;netcoreapp2.1;netcoreapp3.1;net6.0;net8.0 FusionAuth