Skip to content

Commit

Permalink
ci: move semantic-release to GitHub Action
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Feb 10, 2020
1 parent 524dd29 commit d0694a7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,23 @@
on:
push:
branches:
- master
- next
- beta
- '*.x' # maintenance releases such as 15.x

name: Release
jobs:
build:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: npm ci
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
19 changes: 2 additions & 17 deletions .travis.yml
@@ -1,22 +1,11 @@
language: node_js
cache: npm

# Trigger a push build on master and greenkeeper branches + PRs build on every branches
# Avoid double build on PRs (See https://github.com/travis-ci/travis-ci/issues/1147)
branches:
only:
- master
- /^greenkeeper.*$/
- beta # semantic-release preview releases
- next # semantic-release @next releases
- /^\d+\.x$/ # semantic-release maintenance releases

stages:
- name: release
if: branch =~ /^(\d+\.x|master|next|beta)$/ AND type IN (push)
- name: update-prettier
if: branch =~ ^greenkeeper/prettier
- /^greenkeeper/prettier.*$/

# TODO: move over to separate action
jobs:
include:
- stage: update-prettier
Expand All @@ -26,7 +15,3 @@ jobs:
- npm run format:fix
# commit changes and push back to branch on GitHub. If there are no changes then exit without error
- 'git commit -a -m "style: prettier" && git push "https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG" ${TRAVIS_BRANCH} || true'
- stage: release
node_js: lts/*
env: semantic-release
script: npm run semantic-release

0 comments on commit d0694a7

Please sign in to comment.