dc/.gitea/workflows/release.yaml

111 lines
3.4 KiB
YAML

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
npm i -g @sasjs/cli
# test
- name: Install JQ for parsing JSON
run: |
apt-get update
apt-get install jq
- 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: 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: Frontend Build
run: |
cd client
npm ci
# Disabled to speed up dev process
# npm run build
# zip -r dist.zip ./dist
touch dist.zip
- 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 artifacts to release
run: |
RELEASE_ID=`curl -k 'https://git.datacontroller.io/api/v1/repos/mihajlo/dc_throwaway/releases/latest?access_token=${{ secrets.RELEASE_TOKEN }}' | jq -r '.id'`
curl -k https://git.datacontroller.io/api/v1/repos/mihajlo/dc_throwaway/releases/$RELEASE_ID/assets?access_token=${{ secrets.RELEASE_TOKEN }} -F attachment=@frontend.zip