Skip to content

Commit

Permalink
Merge pull request #3118 from scratchfoundation/rd/ENG-18/move-to-gha
Browse files Browse the repository at this point in the history
Move scratch-blocks to GHA
  • Loading branch information
Ron de las Alas authored Oct 31, 2023
2 parents f116732 + aa4b456 commit e72818d
Show file tree
Hide file tree
Showing 8 changed files with 1,553 additions and 8,934 deletions.
137 changes: 0 additions & 137 deletions .circleci/config.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
/gh-pages/*
/webpack.config.js
/build/*

/github-pages/*
1 change: 1 addition & 0 deletions .github/CODEOWNERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@scratchfoundation/scratch-engineering
73 changes: 73 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: build-scratch-blocks
on:
push:
branches: [master, develop, beta, hotfix/*]
jobs:
setup:
runs-on: ubuntu-latest
env:
JVM_OPTS: -Xmx3200m
DETECT_CHROMEDRIVER_VERSION: true
PROJECT_PATH: ./scratch-blocks
steps:
- uses: actions/checkout@v3
- name: Install Chrome Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgconf-2-4 libatk1.0-0 libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 libgbm-dev libnss3-dev libxss-dev libasound2
- name: Check Python version
run: python --version
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- uses: browser-actions/setup-chrome@v1
with:
chrome-version: stable
id: setup-chrome
- run: |
echo Installed chromium version: ${{ steps.setup-chrome.outputs.chrome-version }}
${{ steps.setup-chrome.outputs.chrome-path }} --version
- name: Install Node Dependencies
run: npm ci
- name: Lint
run: npm run test:lint
- name: Run Tests
run: npm run test:messages
- name: Run Unit Tests
run: DISPLAY=:99 npm run test:unit
- name: Remove Closure App
run: rm -rf gh-pages/closure-library/scripts/ci/CloseAdobeDialog.exe
- name: Deploy playground to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./gh-pages
full_commit_message: "Build for ${{ github.sha }} ${{ github.event.head_commit.message }}"
enable_jekyll: true
- name: Deploy to npm
if: (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/develop') || startsWith(github.ref, 'refs/heads/hotfix') || startsWith(github.ref, 'refs/heads/release') || startsWith(github.ref, 'refs/heads/beta')
run: |
export RELEASE_VERSION="0.2.0-prerelease.$(date +'%Y%m%d%H%M%S')"
if [[ "${{contains(github.ref, 'hotfix')}} ]]; then
export NPM_TAG=hotfix
elif [[ "${{contains(github.ref, 'beta')}} ]]; then
export NPM_TAG=beta
else
export NPM_TAG=latest
fi
echo "Deploying version $RELEASE_VERSION to $NPM_TAG"
npm --no-git-tag-version version $RELEASE_VERSION
npm set //registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}
npm publish --tag $NPM_TAG
if npm info | grep -q $RELEASE_VERSION; then
git tag $RELEASE_VERSION
git push \
https://${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git \
$RELEASE_VERSION
fi
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18
Loading

0 comments on commit e72818d

Please sign in to comment.