Skip to content

Commit

Permalink
complete workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
imolorhe committed Oct 16, 2021
1 parent 0af08a0 commit 70385b0
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 54 deletions.
49 changes: 0 additions & 49 deletions .github/workflows/release-choco.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions VERSION
@@ -0,0 +1 @@
4.0.11
15 changes: 15 additions & 0 deletions bin/update_version.sh
Expand Up @@ -16,6 +16,15 @@ CWEX_NEW_BASE=" version: $NEW_VERSION"
XML_OLD_BASE='<version>.*</version>'
XML_NEW_BASE="<version>$NEW_VERSION</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

Expand All @@ -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;
Expand Down
6 changes: 1 addition & 5 deletions 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'
Expand Down

0 comments on commit 70385b0

Please sign in to comment.