diff --git a/.github/workflows/release-choco.yml b/.github/workflows/release-choco.yml deleted file mode 100644 index 296b4d96c2..0000000000 --- a/.github/workflows/release-choco.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Choco release - TEST - -on: - pull_request: - -jobs: - electron: - strategy: - matrix: - os: [windows-latest] - node-version: [14.x] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: yarn --frozen-lockfile - - run: yarn --cwd packages/altair-electron - # - uses: nick-invision/retry@v2 - # with: - # timeout_minutes: 15 - # max_attempts: 3 - # command: yarn lerna bootstrap - - name: Build/release Electron app - uses: CryogenicPlanet/action-electron-builder@v2 # Using CryogenicPlanet until the main action adds skip_install - with: - github_token: ${{ secrets.github_token }} - package_root: packages/altair-electron/ - skip_build: true - skip_install: true - args: '--publish never' - max_attempts: 3 - - name: chocolatey pack - uses: crazy-max/ghaction-chocolatey@v1.6.0 - with: - args: pack chocolatey\altair-graphql.nuspec - - name: chocolatey install (test packing) - uses: crazy-max/ghaction-chocolatey@v1.6.0 - with: - args: install altair-graphql.4.0.11.nupkg - - name: Add mask - run: | - echo "::add-mask::${{ secrets.CHOCOLATEY_API_KEY }}" - - name: chocolatey push - uses: crazy-max/ghaction-chocolatey@v1.6.0 - with: - args: push altair-graphql.4.0.11.nupkg -s https://push.chocolatey.org/ -k="'${{ secrets.CHOCOLATEY_API_KEY }}'" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index abde2a1788..ba3e3e2fa6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,6 +71,30 @@ jobs: # macOS notarization API key API_KEY_ID: ${{ secrets.apple_api_key_id }} API_KEY_ISSUER_ID: ${{ secrets.apple_api_key_issuer_id }} + + # chocolatey + - name: Read VERSION file + id: getversion + run: echo "::set-output name=version::$(cat VERSION)" + - name: Add mask + run: | + echo "::add-mask::${{ secrets.CHOCOLATEY_API_KEY }}" + - name: chocolatey pack + if: startsWith(matrix.os, 'windows') + uses: crazy-max/ghaction-chocolatey@v1.6.0 + with: + args: pack chocolatey\altair-graphql.nuspec + - name: chocolatey install (test choco packaging) + if: startsWith(matrix.os, 'windows') + uses: crazy-max/ghaction-chocolatey@v1.6.0 + with: + args: install altair-graphql.${{ steps.getversion.outputs.version }}.nupkg + - name: chocolatey push + if: startsWith(matrix.os, 'windows') + uses: crazy-max/ghaction-chocolatey@v1.6.0 + with: + args: push altair-graphql.${{ steps.getversion.outputs.version }}.nupkg -s https://push.chocolatey.org/ -k="'${{ secrets.CHOCOLATEY_API_KEY }}'" + npm-publish: runs-on: ubuntu-latest needs: electron diff --git a/VERSION b/VERSION new file mode 100644 index 0000000000..9f6b1557a0 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +4.0.11 \ No newline at end of file diff --git a/bin/update_version.sh b/bin/update_version.sh index 26abaec3ba..c4d6cce069 100755 --- a/bin/update_version.sh +++ b/bin/update_version.sh @@ -16,6 +16,15 @@ CWEX_NEW_BASE=" version: $NEW_VERSION" XML_OLD_BASE='.*' XML_NEW_BASE="$NEW_VERSION" +PS1_OLD_BASE='altair_.*_x64_win' +PS1_NEW_BASE="altair_${NEW_VERSION}_x64_win" + +VERSION_OLD_BASE='.*' +VERSION_NEW_BASE=$NEW_VERSION + +# Update version in VERSION file +sed -i '' "s|$VERSION_OLD_BASE|$VERSION_NEW_BASE|g" ./VERSION + # Update version in manifest.json sed -i '' "s|$OLD_BASE|$NEW_BASE|g" ./chrome-ext-files/manifest.json @@ -25,6 +34,12 @@ sed -i '' "s|$OLD_BASE|$NEW_BASE|g" ./package.json # Update version in cwex.yml sed -i '' "s|$CWEX_OLD_BASE|$CWEX_NEW_BASE|g" ./cwex.yml +# Update version in altair-graphql.nuspec +sed -i '' "s|$XML_OLD_BASE|$XML_NEW_BASE|g" ./chocolatey/altair-graphql.nuspec + +# Update version in altair-graphql.nuspec +sed -i '' "s|$PS1_OLD_BASE|$PS1_NEW_BASE|g" ./chocolatey/tools/chocolateyInstall.ps1 + if (lerna --version); then # Set the lerna packages versions as well lerna version $NEW_VERSION --force-publish=* --no-git-tag-version --no-push --yes; diff --git a/chocolatey/tools/chocolateyInstall.ps1 b/chocolatey/tools/chocolateyInstall.ps1 index 4f5f98a55c..944aca5b0b 100644 --- a/chocolatey/tools/chocolateyInstall.ps1 +++ b/chocolatey/tools/chocolateyInstall.ps1 @@ -1,17 +1,13 @@ $ErrorActionPreference = 'Stop'; # stop on all errors $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" -# TODO: Update urls -# $url = 'https://github.com/imolorhe/altair/releases/download/v2.4.3/altair_4.0.11_x64_win.exe' -# $url64 = 'https://github.com/imolorhe/altair/releases/download/v2.4.3/altair_4.0.11_x64_win.exe' $fileLocation = Join-Path $toolsDir '..\bins\altair_4.0.11_x64_win.exe' + $packageArgs = @{ packageName = $env:ChocolateyPackageName unzipLocation = $toolsDir fileType = 'EXE' file = $fileLocation file64 = $fileLocation - # url = $url - # url64bit = $url64 softwareName = 'altair-graphql*' checksum = '' # TODO: Figure this out checksumType = 'sha256'