Skip to content

Commit

Permalink
Merge pull request #169 from AUS-DOH-Safety-and-Quality/api-builds
Browse files Browse the repository at this point in the history
Update workflow to publish both new and old api versions for compatibility
  • Loading branch information
andrjohns authored Sep 14, 2023
2 parents 4020eaf + 99e0918 commit 311ffb8
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 13 deletions.
47 changes: 41 additions & 6 deletions .github/workflows/push_to_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,69 @@ on:
branches: [ main ]

jobs:
pre-release:
build-pbiviz-packages:
name: "Pre Release"
runs-on: "ubuntu-latest"

strategy:
matrix:
node-version: [16.x]
config:
- { node-version: 20.x, powerbi-api: current }
- { node-version: 20.x, powerbi-api: 3.8.3 }

steps:

- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js ${{ matrix.config.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Update PowerBI Visuals API Version
if: matrix.config.powerbi-api != 'current'
run: |
sed -i 's/\("apiVersion":\)"\([0-9.]*\)",/\1"${{ matrix.config.powerbi-api }}",/g' pbiviz.json
sed -i 's/\("powerbi-visuals-api": \)"~\([0-9.]*\)",/\1"~${{ matrix.config.powerbi-api }}",/g' package.json
sed -i 's/[[:space:]]*"privileges":[[:space:]]\[\],//g' capabilities.json
shell: bash

- name: Build
run: |
npm install
npm install -g powerbi-visuals-tools
pbiviz package
- name: Rename pbiviz for old API
if: matrix.config.powerbi-api != 'current'
run: |
cd dist
OLDFILE=$(ls *.pbiviz)
NEWFILE=$(ls *.pbiviz | sed "s/\(.*\)\(.pbiviz\)/\1-oldapi.pbiviz/g")
mv $OLDFILE $NEWFILE
shell: bash

- name: Stash built visuals
uses: actions/upload-artifact@master
with:
name: packages
path: dist/*.pbiviz

publish-release:
name: Publish Packages as Release
needs: build-pbiviz-packages
runs-on: ubuntu-latest
steps:
- name: Restore built pacakges
uses: actions/download-artifact@master
with:
name: packages
path: ./packages

- name : "Create Release"
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: "Development Build"
files: dist/*.pbiviz
files: packages/*.pbiviz
14 changes: 7 additions & 7 deletions capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
"sorting": {
"implicit": { "clauses": [{ "role": "key", "direction": 1 }] }
},
"tooltips": {
"supportedTypes": { "default": true, "canvas": true },
"roles": [ "tooltips" ],
"supportEnhancedTooltips": true
},
"privileges": [],
"dataRoles": [
{ "displayName": "Outcome/Numerator", "name": "numerators", "kind": "Measure" },
{ "displayName": "Denominator", "name": "denominators", "kind": "Measure" },
Expand Down Expand Up @@ -577,11 +583,5 @@
]
}
}
}],
"tooltips": {
"supportedTypes": { "default": true, "canvas": true },
"roles": [ "tooltips" ],
"supportEnhancedTooltips": true
},
"privileges": []
}]
}

0 comments on commit 311ffb8

Please sign in to comment.