diff --git a/.github/workflows/build-master.yml b/.github/workflows/build-master.yml new file mode 100644 index 0000000..6c15fd8 --- /dev/null +++ b/.github/workflows/build-master.yml @@ -0,0 +1,46 @@ +name: Build (master) + +on: + workflow_dispatch: + push: + branches: [master] + +permissions: + contents: read + pages: write + id-token: write + +jobs: + build: + uses: ./.github/workflows/build.yml + + deploy-pages: + needs: build + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 + + deploy-aws: + needs: build + runs-on: ubuntu-latest + steps: + - run: sudo apt-get update + - run: sudo apt-get install awscli + - uses: actions/download-artifact@v2 + with: + name: github-pages + - run: | + mkdir pages + tar xf artifact.tar -C pages + - run: ls -R pages + - name: aws s3 sync + run: | + aws configure set region eu-central-1 + aws configure set aws_access_key_id ${{secrets.AWS_ACCESS_KEY_ID}} + aws configure set aws_secret_access_key ${{secrets.AWS_SECRET_ACCESS_KEY}} + aws s3 sync pages/ s3://${{secrets.AWS_SITE_BUCKET}}/waforth/ diff --git a/.github/workflows/build-standalone.yml b/.github/workflows/build-standalone.yml index 32758e9..2b72dbe 100644 --- a/.github/workflows/build-standalone.yml +++ b/.github/workflows/build-standalone.yml @@ -13,7 +13,7 @@ jobs: os: [macos-latest, ubuntu-18.04, windows-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./.github/actions/setup - run: make -C src/standalone install-deps package - run: make -C src/standalone check diff --git a/.github/workflows/build-vscode-extension.yml b/.github/workflows/build-vscode-extension.yml index e0de682..0efa909 100644 --- a/.github/workflows/build-vscode-extension.yml +++ b/.github/workflows/build-vscode-extension.yml @@ -10,6 +10,6 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./.github/actions/setup - - run: make -C src/web/vscode-extension install-deps package \ No newline at end of file + - run: make -C src/web/vscode-extension install-deps package diff --git a/.github/workflows/build-waforthc.yml b/.github/workflows/build-waforthc.yml index 559853a..06aa1b8 100644 --- a/.github/workflows/build-waforthc.yml +++ b/.github/workflows/build-waforthc.yml @@ -13,7 +13,7 @@ jobs: os: [macos-latest, ubuntu-20.04] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./.github/actions/setup - if: runner.os == 'macOS' || runner.os == 'Windows' diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a5ee679..e72e7c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,7 @@ name: Build on: push: + branches: ['*', '!master'] pull_request: workflow_dispatch: workflow_call: @@ -10,9 +11,19 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./.github/actions/setup - run: yarnpkg build - - run: make -C src/web/notebook - run: yarnpkg lint - run: yarnpkg test --coverage + - run: make -C src/web/notebook + - run: ./dist/wafnb2html src/web/notebook/examples/drawing-with-forth.wafnb + + # Build & upload pages + - run: | + mkdir -p public/waforth/drawing-with-forth + cp src/web/notebook/examples/drawing-with-forth.html public/waforth/drawing-with-forth/index.html + shell: bash + - uses: actions/upload-pages-artifact@v1 + with: + path: public/waforth diff --git a/.github/workflows/publish-notebook.yml b/.github/workflows/publish-notebook.yml deleted file mode 100644 index cf4a253..0000000 --- a/.github/workflows/publish-notebook.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Publish Notebook - -on: - workflow_dispatch: - -jobs: - build: - uses: ./.github/workflows/build.yml - - publish: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: ./.github/actions/setup - - run: sudo apt-get update - - run: sudo apt-get install awscli - - run: make -C src/web/notebook - - run: ./dist/wafnb2html src/web/notebook/examples/drawing-with-forth.wafnb - - name: aws s3 sync - run: | - aws configure set region eu-central-1 - aws configure set aws_access_key_id ${{secrets.AWS_ACCESS_KEY_ID}} - aws configure set aws_secret_access_key ${{secrets.AWS_SECRET_ACCESS_KEY}} - aws s3 cp src/web/notebook/examples/drawing-with-forth.html s3://${{secrets.AWS_SITE_BUCKET}}/wafnb/drawing-with-forth/index.html diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 1704571..a93b0ef 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -12,24 +12,8 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./.github/actions/setup - run: yarnpkg publish --non-interactive env: NPM_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - publish-site: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: ./.github/actions/setup - - run: sudo apt-get update - - run: sudo apt-get install awscli - - run: yarnpkg build - - name: aws s3 sync - run: | - aws configure set region eu-central-1 - aws configure set aws_access_key_id ${{secrets.AWS_ACCESS_KEY_ID}} - aws configure set aws_secret_access_key ${{secrets.AWS_SECRET_ACCESS_KEY}} - aws s3 sync public/waforth/ s3://${{secrets.AWS_SITE_BUCKET}}/waforth/ diff --git a/.github/workflows/publish-standalone.yml b/.github/workflows/publish-standalone.yml index e904323..bb1cbf9 100644 --- a/.github/workflows/publish-standalone.yml +++ b/.github/workflows/publish-standalone.yml @@ -15,7 +15,7 @@ jobs: os: [macos-latest, ubuntu-18.04, windows-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./.github/actions/setup - run: make -C src/standalone install-deps package - run: make -C src/standalone check diff --git a/.github/workflows/publish-thurtle.yml b/.github/workflows/publish-thurtle.yml deleted file mode 100644 index 51d9361..0000000 --- a/.github/workflows/publish-thurtle.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Publish Thurtle - -on: - workflow_dispatch: - -jobs: - build: - uses: ./.github/workflows/build.yml - - publish: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: ./.github/actions/setup - - run: sudo apt-get update - - run: sudo apt-get install awscli - - run: yarnpkg build - - name: aws s3 sync - run: | - aws configure set region eu-central-1 - aws configure set aws_access_key_id ${{secrets.AWS_ACCESS_KEY_ID}} - aws configure set aws_secret_access_key ${{secrets.AWS_SECRET_ACCESS_KEY}} - aws s3 sync public/thurtle/ s3://${{secrets.AWS_SITE_BUCKET}}/thurtle/ - aws s3 sync public/waforth/dist/ s3://${{secrets.AWS_SITE_BUCKET}}/waforth/dist/ --exclude "*" --include "thurtle-*" --include "logo-*.svg" --include "turtle-*.svg" - diff --git a/.github/workflows/publish-waforthc.yml b/.github/workflows/publish-waforthc.yml index 78f7b26..ec6e1a4 100644 --- a/.github/workflows/publish-waforthc.yml +++ b/.github/workflows/publish-waforthc.yml @@ -15,7 +15,7 @@ jobs: os: [macos-latest, ubuntu-20.04] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./.github/actions/setup - if: runner.os == 'macOS' || runner.os == 'Windows' diff --git a/build-web.js b/build-web.js index 5224d2e..4c419ab 100755 --- a/build-web.js +++ b/build-web.js @@ -98,7 +98,7 @@ async function handleBuildFinished(result) { ["WAForh Benchmarks", "benchmarks", "public/waforth/benchmarks"], ["WAForth Prompt Example", "prompt", "public/waforth/examples/prompt"], ["WAForth Fetch Example", "fetch", "public/waforth/examples/fetch"], - ["Thurtle", "thurtle", "public/thurtle", true], + ["Thurtle", "thurtle", "public/waforth/thurtle", true], ]; for (const [title, base, outpath, bs] of indexes) { let index = INDEX_TEMPLATE.replace(/\$BASE/g, base).replace(