diff --git a/.appveyor/appveyor.yml b/.appveyor/appveyor.yml deleted file mode 100644 index 4f8b56070..000000000 --- a/.appveyor/appveyor.yml +++ /dev/null @@ -1,57 +0,0 @@ -skip_non_tags: true -image: Visual Studio 2019 -clone_folder: c:\gopath\src\github.com\versent\saml2aws -environment: - GOPATH: c:\gopath - CHOCOLATEY_APIKEY: - secure: 3kWTz99Qj+ipyaR73CxcJeGRRbmk84MF2ERDu6MyY10cjHAi6s3AVZ2Ccoa+Ioyt - appName: saml2aws -install: -- set PATH=C:\msys64\mingw64\bin;C:\go121\bin;%PATH% -- set GOROOT=C:\go121 -- ps: >- - $VerbosePreference = 'Continue' - - write-output $env:GOPATH - - write-output $env:APPVEYOR_REPO_TAG_NAME - - write-output $env:APPVEYOR_REPO_TAG_NAME.Split('v')[1] - - write-output $env:GOROOT - - $env:Path += ";`"$env:GOPATH\bin`";c:\go\bin;" - - write-output $env:PATH - - go version - - go env - - Install-PackageProvider -Name NuGet -Force - - Install-Module InvokeBuild -Force -build_script: -- cmd: go mod download -- ps: >- - Invoke-Build -test_script: -- cmd: go test -v . - -artifacts: -- path: $(appName).zip -- path: $(appName).zip.sha256 -- path: 'choco/$(appName).*.nupkg' -- path: 'choco/$(appName).*.nupkg.sha256' -#deploy: -#- provider: GitHub -# release: saml2aws-$(appveyor_build_version) -# auth_token: -# secure: kxO8LOQfcXH15OdilgteFKRn4Y7vUQND84WaR2fgghgiwTTHPLgKV1j+6o/8Ggjx -# artifact: saml2aws.zip, saml2aws.zip.sha256, choco/saml2aws.1.3.2.nupkg, choco/saml2aws.1.3.2.nupkg.sha256 -# draft: true -deploy_script: -- ps: >- - choco apiKey -k $env:CHOCOLATEY_APIKEY -source https://push.chocolatey.org/ - - choco push ./choco/${env:appName}.$(($env:APPVEYOR_REPO_TAG_NAME).Split('v')[1]).nupkg diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e13a39cc..fd6428620 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -114,7 +114,65 @@ jobs: cat "${INSTALLER}/wix.sh" | docker run --rm -i -e VERSION -v "${INSTALLER}:/wix" ${WIXIMG} /bin/sh - name: Upload the asset to the release - uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0 # v0.2.0.6.2.0.65 / v2.0.6 + uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v0.2.0.8.2.0.85 / v2.0.8 with: tag_name: ${{ env.VER_TAG }} files: ${{ env.INSTALLER }}/out/*.msi + + chocolatey: + name: Deploy to chocolatey + runs-on: windows-latest + permissions: + contents: write + needs: [release] + if: >- # https://github.com/actions/runner/issues/491 + always() && + (needs.release.result == 'success' || needs.release.result == 'skipped') + steps: + - name: Normalize tag values + shell: bash + run: | + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]] ; then + VER=${{ github.event.inputs.tag }} + else + VER=${GITHUB_REF/refs\/tags\//} + fi + + VERSION=${VER//v} + + echo "VER_TAG=$VER" >> $GITHUB_ENV + echo "VERSION=$VERSION" >> $GITHUB_ENV + + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup PowerShell module cache + id: cacher + uses: actions/cache@v3 + with: + path: "C:\\Users\\runneradmin\\Documents\\PowerShell\\Modules" + key: ${{ runner.os }}-InvokeBuild + + - name: Install required PowerShell modules + if: steps.cacher.outputs.cache-hit != 'true' + shell: pwsh + run: | + Set-PSRepository PSGallery -InstallationPolicy Trusted + Install-Module InvokeBuild -ErrorAction Stop + + - name: Invoke build script + env: + appName: saml2aws + shell: pwsh + run: Invoke-Build + + - name: Deploy + shell: pwsh + env: + CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }} + VERSION: ${{ env.VERSION }} + run: | + choco apikey --key "$env:CHOCOLATEY_API_KEY" --source "https://push.chocolatey.org/" + choco push ./choco/saml2aws.${env:VERSION}.nupkg --source "https://push.chocolatey.org/" diff --git a/default.build.ps1 b/default.build.ps1 index 0e507b06e..95392db64 100644 --- a/default.build.ps1 +++ b/default.build.ps1 @@ -1,7 +1,7 @@ Set-StrictMode -Version 'Latest' #$nameOfApp = 'saml2aws' -$version = ${env:APPVEYOR_REPO_TAG_NAME}.Split('v')[1] +$version = ${env:VER_TAG}.Split('v')[1] task 'Compile Go libraries...' { $ErrorActionPreference = 'Continue' @@ -23,7 +23,7 @@ task 'Pack Choco...' { } task 'Zip for GH release...' { - 7z a "${env:appName}.zip" "$env:APPVEYOR_BUILD_FOLDER\bin\${env:appName}.exe" + 7z a "${env:appName}.zip" ".\bin\${env:appName}.exe" $hash = Get-FileHash "${env:appName}.zip" "$($hash.Hash) $(Split-Path $hash.Path -Leaf)" > "${env:appName}.zip.sha256" } diff --git a/go.mod b/go.mod index 0290566e3..37814800d 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/versent/saml2aws/v2 -go 1.21 +go 1.21.0 + +toolchain go1.22.5 require ( github.com/99designs/keyring v1.2.2 @@ -10,7 +12,7 @@ require ( github.com/alecthomas/kingpin v2.2.6+incompatible github.com/avast/retry-go v3.0.0+incompatible github.com/aws/aws-sdk-go v1.55.0 - github.com/beevik/etree v1.4.0 + github.com/beevik/etree v1.4.1 github.com/danieljoos/wincred v1.2.2 github.com/google/uuid v1.6.0 github.com/h2non/gock v1.2.0 @@ -22,7 +24,7 @@ require ( github.com/sirupsen/logrus v1.9.3 github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 github.com/stretchr/testify v1.9.0 - github.com/tidwall/gjson v1.17.1 + github.com/tidwall/gjson v1.17.2 github.com/trimble-oss/go-webauthn-client v0.3.0 golang.org/x/net v0.27.0 gopkg.in/ini.v1 v1.67.0 diff --git a/go.sum b/go.sum index 9353107fc..8951064fe 100644 --- a/go.sum +++ b/go.sum @@ -28,8 +28,8 @@ github.com/aws/aws-sdk-go v1.55.0 h1:hVALKPjXz33kP1R9nTyJpUK7qF59dO2mleQxUW9mCVE github.com/aws/aws-sdk-go v1.55.0/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= github.com/bearsh/hid v1.3.0 h1:GLNa8hvEzJxzQEEpheDUr2SivvH7iwTrJrDhFKutfX8= github.com/bearsh/hid v1.3.0/go.mod h1:KbQByg8WfPr92v7aaKAHTtZUEVG7e2XRpcF8+TopQv8= -github.com/beevik/etree v1.4.0 h1:oz1UedHRepuY3p4N5OjE0nK1WLCqtzHf25bxplKOHLs= -github.com/beevik/etree v1.4.0/go.mod h1:cyWiXwGoasx60gHvtnEh5x8+uIjUVnjWqBvEnhnqKDA= +github.com/beevik/etree v1.4.1 h1:PmQJDDYahBGNKDcpdX8uPy1xRCwoCGVUiW669MEirVI= +github.com/beevik/etree v1.4.1/go.mod h1:gPNJNaBGVZ9AwsidazFZyygnd+0pAU38N4D+WemwKNs= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= @@ -179,8 +179,8 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/tidwall/gjson v1.17.1 h1:wlYEnwqAHgzmhNUFfw7Xalt2JzQvsMx2Se4PcoFCT/U= -github.com/tidwall/gjson v1.17.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.17.2 h1:YlBFFaxZdSXKP8zhqh5CRbk0wL7oCAU3D+JJLU5pE7U= +github.com/tidwall/gjson v1.17.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=