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..30ea111 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: Release new version of Serverless Migrate Plugin + +on: + release: + types: [published] +jobs: + release: + name: Release + 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: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: "lts/*" + + - name: Install dependencies + run: npm ci + + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm publish --provenance --access public 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/INTERNAL.md b/INTERNAL.md new file mode 100644 index 0000000..b38fe33 --- /dev/null +++ b/INTERNAL.md @@ -0,0 +1,39 @@ + +Serverless plugin for migrate +============================== +[![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 +migrations. To do so, it works on top of [migrate][migrate-npm]. + +## How to release +The release will be triggered by the presence of a tag and a version bump. This is made as follows + +1. Generate the new version + ```bash + npm version major + ``` + or + + ```bash + npm version minor + ``` + + or + + ```bash + npm version minor + ``` + + or just specify the whole version (beware of not repeating it) + + ```bash + npm version + ``` +This will generate a version and a tag + +1. Push the commit with the correspoding tag and that will trigger the release + + ```bash + git push origin --tags + ``` diff --git a/README.md b/README.md index 88d0df2..f0c96c0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ Serverless plugin for migrate ============================== -[![serverless](http://public.serverless.com/badges/v3.svg)](http://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