mirror of
https://github.com/sasjs/core.git
synced 2026-06-08 12:00:21 +00:00
92 lines
3.2 KiB
YAML
92 lines
3.2 KiB
YAML
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
|
|
|
|
name: SASjs Core Publish
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
npm ci
|
|
|
|
- name: Check code style (aborts if errors found)
|
|
run: npx @sasjs/cli lint
|
|
|
|
- name: Write VPN Files
|
|
run: |
|
|
echo "$CA_CRT" > .github/vpn/ca.crt
|
|
echo "$USER_CRT" > .github/vpn/user.crt
|
|
echo "$USER_KEY" > .github/vpn/user.key
|
|
echo "$TLS_KEY" > .github/vpn/tls.key
|
|
shell: bash
|
|
env:
|
|
CA_CRT: ${{ secrets.CA_CRT}}
|
|
USER_CRT: ${{ secrets.USER_CRT }}
|
|
USER_KEY: ${{ secrets.USER_KEY }}
|
|
TLS_KEY: ${{ secrets.TLS_KEY }}
|
|
|
|
- name: Install Open VPN
|
|
run: |
|
|
#sudo apt install apt-transport-https
|
|
#sudo wget https://swupdate.openvpn.net/repos/openvpn-repo-pkg-key.pub
|
|
#sudo apt-key add openvpn-repo-pkg-key.pub
|
|
#sudo wget -O /etc/apt/sources.list.d/openvpn3.list https://swupdate.openvpn.net/community/openvpn3/repos/openvpn3-jammy.list
|
|
#sudo apt update
|
|
#sudo apt install openvpn3=17~betaUb22042+jammy
|
|
- name: Start Open VPN 3
|
|
run: |
|
|
# openvpn3 session-start --config .github/vpn/config.ovpn
|
|
|
|
- name: Add credentials
|
|
run: |
|
|
echo "CLIENT=${{secrets.SAS9_4GL_IO_CLIENT}}"> .env.server
|
|
echo "ACCESS_TOKEN=${{secrets.SAS9_4GL_IO_ACCESS_TOKEN}}" >> .env.server
|
|
echo "REFRESH_TOKEN=${{secrets.SAS9_4GL_IO_REFRESH_TOKEN}}" >> .env.server
|
|
|
|
- name: Semantic Release
|
|
id: makerelease
|
|
uses: cycjimmy/semantic-release-action@v6
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
- name: SAS Packages Release
|
|
run: |
|
|
npx @sasjs/cli compile job -s sasjs/utils/create_sas_package.sas -o sasjsbuild -t server
|
|
# need long duration token per https://github.com/sasjs/server/issues/307
|
|
# npx @sasjs/cli run sasjsbuild/jobs/utils/create_sas_package.sas -t server
|
|
|
|
- name: Update Docs Site
|
|
if: steps.makerelease.outputs.new_release_published == 'true'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y doxygen
|
|
npx @sasjs/cli doc -t docsonly
|
|
git clone https://x-access-token:${{ secrets.CORESASJSIO_PAT }}@github.com/sasjs/core.github.io.git
|
|
cd core.github.io
|
|
rm -rf *.html
|
|
rm -rf *.js
|
|
rm -rf *.png
|
|
rm -rf *.dot
|
|
rm -rf *.css
|
|
rm -rf *.svg
|
|
rm -rf search
|
|
cp -R ../sasjsbuild/docs/* .
|
|
ls
|
|
git config user.name sasjs
|
|
echo 'core.sasjs.io' > CNAME
|
|
git add .
|
|
git commit -m "core pipeline build on $(date +%F:%H:%M:%S)"
|
|
git push
|
|
echo "check it out: https://sasjs.github.io/core.github.io/files.html"
|