2023-07-13 11:44:05 +00:00
|
|
|
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}}
|
|
|
|
|
2023-07-25 09:34:58 +00:00
|
|
|
- name: Install ZIP and SASjs CLI
|
2023-07-13 11:44:05 +00:00
|
|
|
run: |
|
|
|
|
apt-get update
|
|
|
|
apt-get install zip
|
2023-07-25 09:34:58 +00:00
|
|
|
npm i -g @sasjs/cli
|
|
|
|
# test
|
2023-07-13 11:44:05 +00:00
|
|
|
|
2023-07-25 09:34:58 +00:00
|
|
|
- name: Install JQ for parsing JSON
|
2023-07-13 11:44:05 +00:00
|
|
|
run: |
|
2023-07-25 09:34:58 +00:00
|
|
|
apt-get update
|
|
|
|
apt-get install jq
|
2023-07-13 11:44:05 +00:00
|
|
|
|
2023-07-25 09:34:58 +00:00
|
|
|
- name: Install Semantic Release and plugins and create Release
|
2023-07-13 11:44:05 +00:00
|
|
|
run: |
|
|
|
|
npm i
|
|
|
|
npm i -g semantic-release
|
2023-07-25 09:34:58 +00:00
|
|
|
GITEA_TOKEN=${{ secrets.RELEASE_TOKEN }} GITEA_URL=https://git.datacontroller.io semantic-release
|
2023-07-13 11:44:05 +00:00
|
|
|
|
2023-07-25 09:34:58 +00:00
|
|
|
- name: Build SAS9 EBI Release
|
|
|
|
description: compile SAS 9 services, remove tests & create deployment program
|
2023-07-13 11:44:05 +00:00
|
|
|
run: |
|
2023-07-25 09:34:58 +00:00
|
|
|
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
|
2023-07-13 11:44:05 +00:00
|
|
|
|
|
|
|
- name: Release Typedoc
|
|
|
|
run: |
|
|
|
|
cd client
|
|
|
|
npm run typedoc
|
2023-07-25 09:34:58 +00:00
|
|
|
# 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
|