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 ZIP and SASjs CLI run: | apt-get update apt-get install zip -y npm i -g @sasjs/cli # test - name: Install JQ for parsing JSON run: | apt-get update apt-get install jq -y - name: Install Semantic Release and plugins and create Release run: | npm i npm i -g semantic-release GITEA_TOKEN=${{ secrets.RELEASE_TOKEN }} GITEA_URL=https://git.datacontroller.io semantic-release - name: Frontend Build 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 typedoc # deploy docs - 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'` 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