name: Release run-name: Releasing DC on: push: branches: - main jobs: release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version: 18 - name: Write .npmrc file run: | echo "$NPMRC" > client/.npmrc echo "legacy-peer-deps=true" >> client/.npmrc shell: bash env: NPMRC: ${{ secrets.NPMRC}} - name: Install packages run: | apt-get update apt-get install zip -y # sasjs cli is used to compile & build the SAS services npm i -g @sasjs/cli # jq is used to parse the release JSON apt-get install jq -y - name: Create Empty Release (assets are posted later) run: | npm i npm i -g semantic-release GITEA_TOKEN=${{ secrets.RELEASE_TOKEN }} GITEA_URL=https://git.datacontroller.io semantic-release - name: Frontend Build description: Must be created AFTER the release as the version (git tag) is used in the interface run: | cd client npm ci npm run build - name: Build SAS9 EBI Release description: Compile SAS 9 services, remove tests & create deployment program run: | cd sas npm ci sasjs c -t sas9 rm -rf sasjsbuild/tests sasjs b -t sas9 cp sasjsbuild/mysas9deploy.sas ./demostream_sas9.sas # # remove streamed component and rebuild SAS 9 services # rm -rf sasjsbuild/services/web9 rm sasjsbuild/services/clickme.sas sasjs b -t sas9 cp sasjsbuild/mysas9deploy.sas ./sas9.sas - name: Build SASjs Server Release description: Compile Base (SASjs) services, remove tests & create deployment JSON run: | cd sas cp sasjs/utils/favicon.ico ../client/dist/favicon.ico sasjs c -t server rm -rf sasjsbuild/tests sasjs b -t server cp sasjsbuild/server.json.zip ./sasjs_server.json.zip - name: Build Viya Release description: compile Viya Streaming Deploy (without tests) run: | cd sas sasjs c -t viya rm -rf sasjsbuild/tests sed -i -e 's/servertype="SASJS"/servertype="SASVIYA"/g' sasjsbuild/services/clickme.html sasjs b -t viya cp sasjsbuild/viya.sas ./demostream_viya.sas # compile Viya Full deploy (without web) rm -rf sasjsbuild/services/web rm sasjsbuild/services/clickme.html sasjs b -t viya cp sasjsbuild/viya.sas ./viya.sas - name: Zip Frontend (including viya.json for full viya deploy) run: | cd sas cp sasjsbuild/viya.json ../client/dist cd .. zip -r frontend.zip ./client/dist - name: Release Typedoc run: | cd client npm run compodoc:build surfer put --token ${{ secrets.TSDOC_TOKEN }} --server tsdoc.datacontroller.io documentation/* / - name: Upload assets to release run: | RELEASE_ID=`curl -k 'https://git.datacontroller.io/api/v1/repos/dc/dc/releases/latest?access_token=${{ secrets.RELEASE_TOKEN }}' | jq -r '.id'` RELEASE_BODY=`curl -k 'https://git.datacontroller.io/api/v1/repos/dc/dc/releases/latest?access_token=${{ secrets.RELEASE_TOKEN }}' | jq -r '.body'` # Update body curl --data '{"draft": true,"body":"'"$RELEASE_BODY\n\nFor installation instructions, please visit https://docs.datacontroller.io/"'"}' -X PATCH --header 'Content-Type: application/json' -k https://git.datacontroller.io/api/v1/repos/dc/dc/releases/$RELEASE_ID?access_token=${{ secrets.RELEASE_TOKEN }} # Upload assets URL="https://git.datacontroller.io/api/v1/repos/dc/dc/releases/$RELEASE_ID/assets?access_token=${{ secrets.RELEASE_TOKEN }}" curl -k $URL -F attachment=@frontend.zip curl -k $URL -F attachment=@sas/demostream_sas9.sas curl -k $URL -F attachment=@sas/demostream_viya.sas curl -k $URL -F attachment=@sas/sasjs_server.json.zip curl -k $URL -F attachment=@sas/sas9.sas curl -k $URL -F attachment=@sas/viya.sas