Skip to content

Commit

Permalink
ci: replace travis by github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
EliuX committed Dec 10, 2024
1 parent f68b23d commit b10defa
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 29 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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 -
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

39 changes: 39 additions & 0 deletions INTERNAL.md
Original file line number Diff line number Diff line change
@@ -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 <version, e.g. 3.1.2>
```
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
```
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit b10defa

Please sign in to comment.