Create main.yml #22
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
name: Node.js CI | |
on: | |
push: | |
tags: | |
- '*' | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Reconfigure git to use HTTP authentication | |
run: > | |
GIT_TRACE=1 git config --global url."https://github.com/".insteadOf ssh://[email protected]/ | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: npm ci | |
timeout-minutes: 2 | |
- run: npm run build --if-present | |
timeout-minutes: 10 | |
#- run: npm test temporarily remove; I think it's failing due to axios module import in odin-react | |
- name: Create zip archive | |
run: | | |
cd build | |
zip -r build.zip . | |
- name: List contents of zip | |
run: unzip -l build/build.zip | |
# - name: Upload build artifact | |
# uses: actions/[email protected] | |
# with: | |
# name: build | |
# path: build/build.zip | |
- name: Create release if tagged | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: ncipollo/release-action@v1 | |
with: | |
artifactErrorsFailBuild: true | |
artifacts: build/build.zip | |
# Create as a draft so that it can be vetted and notes added | |
draft: true | |
generateReleaseNotes: true | |
skipIfReleaseExists: true | |
# Update an existing release, but only if it's draft or prerelease. If notes already exist, leave them. | |
allowUpdates: true | |
updateOnlyUnreleased: true | |
omitBodyDuringUpdate: true | |
# release: | |
# needs: build | |
# runs-on: ubuntu-latest | |
# strategy: | |
# matrix: | |
# node-version: [16.x] | |
# steps: | |
# - name: Download build artifact | |
# uses: actions/[email protected] | |
# with: | |
# name: build | |
# path: build.zip | |
# - name: List contents of zip | |
# run: unzip -l build.zip |