Skip to content

Merge pull request #83 from qoretechnologies/bugfix/description-fix #38

Merge pull request #83 from qoretechnologies/bugfix/description-fix

Merge pull request #83 from qoretechnologies/bugfix/description-fix #38

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Develop Build
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the develop branch
on:
push:
branches:
- develop
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
DevelopBuild:
# The type of runner that the job will run on
runs-on: self-hosted
env:
QORUS_TOKEN: ${{ secrets.QORUS_TOKEN }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Get current time for the commit
- name: Get current time
uses: josStorer/[email protected]
id: current_time
with:
format: YYYYMMDD-HH
utcOffset: '+01:00'
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Get repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Print head git commit message
id: get_head_commit_message
run: echo "::set-output name=HEAD_COMMIT_MESSAGE::$(git show -s --format=%s)"
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: 20.11.0
cache: 'yarn'
# Notify Discord to not restart server
- name: Discord Warning
env:
DISCORD_WEBHOOK: ${{secrets.DISCORD_WEBHOOK_DEV}}
# Mention someone in the embeds
DISCORD_EMBEDS: '[{ "color":16711680, "description": ":exclamation: Tests started, **please do not restart Qorus on Rippy** for the next 30 minutes." }]'
DISCORD_AVATAR: 'https://github.com/qoretechnologies/qorus-vscode/blob/95ad81fa8654fe83bb41f68f4de42ae088298e59/public/q-symbol-small.png?raw=true'
uses: Ilshidur/[email protected]
with:
args: '<@820316067921395752>'
- name: Save release version to outputs
id: save_release_version
run: echo ::set-output name=version::$(node -pe "require('./package.json').version")
- name: Install modules & Create build
id: install_modules
run: |
yarn install
yarn build-prod
yarn build-storybook --quiet
mkdir -p ./develop/ide && cp -R build/* develop/ide
zip -r qorus-ide-develop.zip develop
chmod 644 qorus-ide-develop.zip
- name: Publish to Chromatic
id: chromatic_publish
uses: chromaui/action@latest
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
exitZeroOnChanges: true
onlyChanged: true
# Copy the build to HQ
- name: Copy develop build to HQ
id: copy_develop_build
if: success()
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
echo "${{ secrets.DEPLOY_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
scp -i ~/.ssh/id_rsa qorus-ide-develop.zip ${{ secrets.DEPLOY_USER}}@${{ secrets.DEPLOY_HOST}}:${{ secrets.DEPLOY_PATH }}
- uses: actions/upload-artifact@v4
id: upload_dev_build
if: success()
with:
name: IDE v${{ steps.save_release_version.outputs.version }} develop
path: qorus-ide-develop.zip
retention-days: 30
# Notify Discord if Success
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{secrets.DISCORD_WEBHOOK}}
DISCORD_EMBEDS: '[{ "author": { "icon_url": "https://avatars.githubusercontent.com/${{ github.actor }}", "name": "${{ github.actor }}", "url": "https://github.com/${{github.actor}}" },"url": "https://github.com/${{github.repository}}/commit/${{github.sha}}","fields": [{ "name": "Commit Message", "value": "${{ steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE }}"},{ "name": "Repository", "value": "[${{github.event.repository.name}}](${{github.event.repository.clone_url}})", "inline": true },{ "name": "Branch", "value": "[${{github.ref_name}}](https://github.com/${{github.repository}}/pull/${{github.ref_name}})", "inline": true },{ "name": "Event", "value": "${{github.event_name}}", "inline": true },{ "name": "Author", "value": "[${{github.actor}}](https://github.com/${{github.actor}})", "inline": true },{ "name": "Job", "value": "${{github.job}}", "inline": true},{ "name": "Version", "value": "v${{ steps.save_release_version.outputs.version }}", "inline": true},{ "name": "", "value": "🤖 [Github Action](https://github.com/${{ github.repository}}/actions/runs/${{ github.run_id}}) 🌐 [View Site]( https://magical-starburst-a8bdfc.netlify.app) 📙 [Storybook](${{ steps.chromatic_publish.outputs.storybookUrl }})"}],"color":65280,"footer":{"text": "Published at ${{steps.current_time.outputs.readableTime}}"}}]'
DISCORD_AVATAR: 'https://github.com/qoretechnologies/qorus-vscode/blob/95ad81fa8654fe83bb41f68f4de42ae088298e59/public/q-symbol-small.png?raw=true'
uses: Ilshidur/[email protected]
with:
args: ':white_check_mark: *Development* version of Qorus Developer Tools *v${{ steps.save_release_version.outputs.version }}* successfully created, click the `GitHub Action` link below to download!'
if: success()
# Notify discord if failure
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{secrets.DISCORD_WEBHOOK}}
DISCORD_EMBEDS: '[{ "author": { "icon_url": "https://avatars.githubusercontent.com/${{ github.actor }}", "name": "${{ github.actor }}", "url": "https://github.com/${{github.actor}}" },"url": "https://github.com/${{github.repository}}/commit/${{github.sha}}","fields": [{ "name": "Commit Message", "value": "${{ steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE }}"},{ "name": "Repository", "value": "[${{github.event.repository.name}}](${{github.event.repository.clone_url}})", "inline": true },{ "name": "Branch", "value": "[${{github.ref_name}}](https://github.com/${{github.repository}}/pull/${{github.ref_name}})", "inline": true },{ "name": "Event", "value": "${{github.event_name}}", "inline": true },{ "name": "Author", "value": "[${{github.actor}}](https://github.com/${{github.actor}})", "inline": true },{ "name": "Job", "value": "${{github.job}}", "inline": true },{ "name": "Version", "value": "v${{ steps.save_release_version.outputs.version }}", "inline": true},{ "name": "", "value": "🤖 [Github Action](https://github.com/${{ github.repository}}/actions/runs/${{ github.run_id}})"}],"color":16711680,"footer":{"text": "Published at ${{steps.current_time.outputs.readableTime}}"}}]'
DISCORD_AVATAR: 'https://github.com/qoretechnologies/qorus-vscode/blob/95ad81fa8654fe83bb41f68f4de42ae088298e59/public/q-symbol-small.png?raw=true'
uses: Ilshidur/[email protected]
with:
args: ':exclamation: Creation of VSIX for development version *v${{ steps.save_release_version.outputs.version }}* of Qorus Developer Tools failed! Click the GitHub action below to find out why.'
if: failure()
- name: Discord notification safe to restart
env:
DISCORD_WEBHOOK: ${{secrets.DISCORD_WEBHOOK_DEV}}
DISCORD_EMBEDS: '[{ "color":65280, "description": ":white_check_mark: Tests action finished. It is now safe to restart Qorus on Rippy." }]'
DISCORD_AVATAR: 'https://github.com/qoretechnologies/qorus-vscode/blob/95ad81fa8654fe83bb41f68f4de42ae088298e59/public/q-symbol-small.png?raw=true'
uses: Ilshidur/[email protected]
with:
args: '<@820316067921395752>'
if: always()