|
1 | 1 | name: build-scratch-blocks |
2 | | -on: |
3 | | - push: |
4 | | - branches: [master, develop, beta, hotfix/*] |
| 2 | +on: |
| 3 | + push: # Runs whenever a commit is pushed to the repository |
| 4 | + workflow_dispatch: # Allows you to run this workflow manually from the Actions tab |
5 | 5 | jobs: |
6 | 6 | setup: |
7 | 7 | runs-on: ubuntu-latest |
8 | 8 | env: |
9 | 9 | JVM_OPTS: -Xmx3200m |
10 | | - DETECT_CHROMEDRIVER_VERSION: true |
| 10 | + DETECT_CHROMEDRIVER_VERSION: true |
11 | 11 | PROJECT_PATH: ./scratch-blocks |
12 | 12 | steps: |
13 | 13 | - uses: actions/checkout@v3 |
|
16 | 16 | sudo apt-get update |
17 | 17 | 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 |
18 | 18 | - name: Check Python version |
19 | | - run: python --version |
| 19 | + run: python --version |
20 | 20 | - name: Setup Java |
21 | 21 | uses: actions/setup-java@v3 |
22 | 22 | with: |
|
50 | 50 | publish_dir: ./gh-pages |
51 | 51 | full_commit_message: "Build for ${{ github.sha }} ${{ github.event.head_commit.message }}" |
52 | 52 | enable_jekyll: true |
53 | | - - name: Deploy to npm |
54 | | - 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') |
55 | | - run: | |
56 | | - export RELEASE_VERSION="0.2.0-prerelease.$(date +'%Y%m%d%H%M%S')" |
57 | | - if [[ "${{contains(github.ref, 'hotfix')}} ]]; then |
58 | | - export NPM_TAG=hotfix |
59 | | - elif [[ "${{contains(github.ref, 'beta')}} ]]; then |
60 | | - export NPM_TAG=beta |
61 | | - else |
62 | | - export NPM_TAG=latest |
63 | | - fi |
64 | | - echo "Deploying version $RELEASE_VERSION to $NPM_TAG" |
65 | | - npm --no-git-tag-version version $RELEASE_VERSION |
66 | | - npm set //registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}} |
67 | | - npm publish --tag $NPM_TAG |
68 | | - if npm info | grep -q $RELEASE_VERSION; then |
69 | | - git tag $RELEASE_VERSION |
70 | | - git push \ |
71 | | - https://${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git \ |
72 | | - $RELEASE_VERSION |
73 | | - fi |
| 53 | + - name: Run semantic-release |
| 54 | + env: |
| 55 | + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 56 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 57 | + run: npx --no -- semantic-release |