-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5db8ef0
commit ba1a96d
Showing
3 changed files
with
91 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ on: | |
tags: ["v*"] | ||
|
||
jobs: | ||
Run-Tests: | ||
build-test: | ||
name: CI | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -37,12 +37,71 @@ jobs: | |
- name: Cache sbt | ||
uses: coursier/[email protected] | ||
### Compile and TESTS ### | ||
- run: sbt -mem 2048 -J-Xmx5120m "ciJob" | ||
- name: sbt "ciJob" | ||
run: sbt -mem 2048 -J-Xmx5120m "ciJob" | ||
env: | ||
NODE_OPTIONS: "--openssl-legacy-provider" # This is need after node-version "16" | ||
|
||
- name: Release | ||
if: ((inputs.make_snapshot_release == true) && (github.ref_name == 'master') || startsWith(github.ref, 'refs/tags/v')) | ||
ghpages: | ||
name: Deploy gh-pages | ||
needs: build-test | ||
runs-on: ubuntu-latest | ||
if: (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/feature/gh-pages') | ||
steps: | ||
# https://github.com/japgolly/setup-everything-scala | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Needed for the release tag // `git fetch --tags` will also work | ||
- name: Setup Java and Scala | ||
uses: olafurpg/setup-scala@v14 | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18" # or whatever | ||
- name: Setup Scala.JS | ||
uses: japgolly/setup-scalajs@v1 | ||
- name: Cache sbt | ||
uses: coursier/[email protected] | ||
|
||
### create build deploy gh-pages ### | ||
- name: sbt "docAll; siteAll" | ||
run: sbt -mem 2048-J-Xmx5120m "docAll; siteAll" | ||
|
||
- name: build | ||
run: | | ||
mkdir ./public | ||
cp -r docs/target/site/did-doc/. ./public | ||
cp -r docs/target/scaladoc/unidoc ./public/api | ||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./public | ||
|
||
publish: | ||
name: Publish Artifacts | ||
needs: build-test | ||
runs-on: ubuntu-latest | ||
if: ((inputs.make_snapshot_release == true) && (github.ref_name == 'master') || startsWith(github.ref, 'refs/tags/v')) | ||
steps: | ||
# https://github.com/japgolly/setup-everything-scala | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Needed for the release tag // `git fetch --tags` will also work | ||
- name: Setup Java and Scala | ||
uses: olafurpg/setup-scala@v14 | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18" # or whatever | ||
- name: Setup Scala.JS | ||
uses: japgolly/setup-scalajs@v1 | ||
- name: Cache sbt | ||
uses: coursier/[email protected] | ||
|
||
### Publish Artifacts ### | ||
- name: publish | ||
run: sbt ci-release | ||
env: | ||
NODE_OPTIONS: "--openssl-legacy-provider" # This is need after node-version "16" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
scriptdir="$(dirname "$0")" | ||
currentBranch="$(git branch --show-current)" | ||
inputAPI="$scriptdir/target/scaladoc/unidoc" | ||
outdir="$scriptdir/target/gppages" | ||
|
||
[[ -z $(git status -uall --porcelain) ]] && { | ||
(cd "$scriptdir/.." ; sbt -mem 2048 -J-Xmx5120m "docAll; siteAll") # clean; | ||
mkdir -p $outdir | ||
cp -r "$scriptdir/target/site/did-doc/." "$outdir/" && | ||
cp -r "$scriptdir/target/scaladoc/unidoc" "$outdir/api" && | ||
git branch gh-pages && | ||
git checkout gh-pages && | ||
git pull && | ||
git add --force "$outdir" && | ||
git commit -m "gh-pages update at $(date '+%Y%m%d-%H%M%S')" && | ||
git push --set-upstream origin gh-pages -f && | ||
git checkout $currentBranch && | ||
git branch -d gh-pages # delete branch locally | ||
} || echo "This branch is NOT clean." | ||
|
||
#Now check https://fabiopinheiro.github.io/scala-did/ | ||
#aka https://doc.did.fmgp.app/ |