From 99cce3b371ce1e58a79f48ec7772d9d292af54e0 Mon Sep 17 00:00:00 2001 From: Romain Beaumont Date: Sun, 14 Mar 2021 00:49:17 +0100 Subject: [PATCH] setup some CI and basics (#47) --- .github/workflows/ci.yml | 25 +++++++++++++++++++++++++ .github/workflows/publish.yml | 32 ++++++++++++++++++++++++++++++++ .gitpod | 4 ++++ .gitpod.DockerFile | 8 ++++++++ .npmrc | 1 + 5 files changed, 70 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/publish.yml create mode 100644 .gitpod create mode 100644 .gitpod.DockerFile create mode 100644 .npmrc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e8525e8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm test \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..387db40 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: npm-publish +on: + push: + branches: + - master # Change this to your default branch +jobs: + npm-publish: + name: npm-publish + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@master + - name: Set up Node.js + uses: actions/setup-node@master + with: + node-version: 14.0.0 + - id: publish + uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_AUTH_TOKEN }} + - name: Create Release + if: steps.publish.outputs.type != 'none' + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.publish.outputs.version }} + release_name: Release ${{ steps.publish.outputs.version }} + body: ${{ steps.publish.outputs.version }} + draft: false + prerelease: false \ No newline at end of file diff --git a/.gitpod b/.gitpod new file mode 100644 index 0000000..ff9c720 --- /dev/null +++ b/.gitpod @@ -0,0 +1,4 @@ +image: + file: .gitpod.DockerFile +tasks: +- command: npm install \ No newline at end of file diff --git a/.gitpod.DockerFile b/.gitpod.DockerFile new file mode 100644 index 0000000..061bf59 --- /dev/null +++ b/.gitpod.DockerFile @@ -0,0 +1,8 @@ +FROM gitpod/workspace-full:latest + +RUN bash -c ". .nvm/nvm.sh \ + && nvm install 14 \ + && nvm use 14 \ + && nvm alias default 14" + +RUN echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix \ No newline at end of file diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..9cf9495 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false \ No newline at end of file