From 854a0544bb6cdbcdd9363e7d11188fd73b4a3b01 Mon Sep 17 00:00:00 2001 From: EliuX Date: Tue, 10 Dec 2024 13:24:02 -0500 Subject: [PATCH] ci: replace travis by github actions --- .github/workflows/main.yml | 38 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 31 ++++++++++++++++++++++++++++ .travis.yml | 28 -------------------------- README.md | 2 +- 4 files changed, 70 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/release.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..8ae8ca4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,38 @@ +name: Serverless Migrate Plugin CI + +on: + push: + branches: [ feature/update-readme-custom-migrate ] + pull_request: + branches: [ feature/update-readme-custom-migrate ] +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: "lts/*" + + - name: Install dependencies for CI + run: npm ci + + - name: Link package + run: | + cd ${GITHUB_WORKSPACE}/example + npm link serverless-migrate-plugin + + - name: Build and test + run: | + cd ${GITHUB_WORKSPACE}/example + npm run create + npm run up + npm run down + npm run list + echo It is all good man! + cd - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5330ad7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release new version of Serverless Migrate Plugin + +on: + push: + branches: [ feature/update-readme-custom-migrate ] + release: + types: [published] +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write # to be able to publish a GitHub release + issues: write # to be able to comment on released issues + pull-requests: write # to be able to comment on released pull requests + id-token: write # to enable use of OIDC for npm provenance + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: "lts/*" + + - name: Install dependencies for CI + run: npm ci + + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npx semantic-release diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4cf527d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -dist: trusty -language: node_js -node_js: - - lts/* -before_install: - - npm install - - npm link - - cd ${TRAVIS_BUILD_DIR}/example - - npm install -g serverless - - npm link serverless-migrate-plugin - - npm install -install: - - echo "Running basic commands" - - npm run create - - npm run up - - npm run down - - npm run list - - echo It is all good man! -after_success: - - cd .. -deploy: - provider: npm - email: $NPM_USER - api_key: $NPM_TOKEN - edge: true - on: - tags: true - repo: EliuX/serverless-migrate-plugin diff --git a/README.md b/README.md index 88d0df2..07d8977 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Serverless plugin for migrate ============================== -[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com) +[![serverless](https://badges.serverless.com/v3.svg)](https://www.serverless.com) [![npm version](https://badge.fury.io/js/serverless-migrate-plugin.svg)](https://badge.fury.io/js/serverless-migrate-plugin) This is a plugin for the [Serverless][serverless-web] framework that allows you to manage and run database-agnostic