Skip to content

Commit

Permalink
Merge pull request #91 from Typeform/chore/REACH-550-use-release-work…
Browse files Browse the repository at this point in the history
…flow

Migrate from Travis to Git Hub release workflow.
  • Loading branch information
gierlas authored Jul 4, 2023
2 parents d9d56c5 + d0eace4 commit 7050f43
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 42 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build

on:
pull_request:
branches:
- main

push:
branches:
- main
- beta

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
token: ${{ secrets.GH_TOKEN }}

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Get yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: |
**/node_modules
~/.cache
key: ${{ runner.os }}-node-16-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('.github/workflows/**.yml') }}

- name: Install Node.js dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile

- run: yarn lint

- run: yarn test:unit
- run: (yarn server &) && sleep 1 && yarn test:integration

- run: yarn build

- run: yarn semantic-release
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/beta') }}
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

18 changes: 7 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,13 @@
}
},
"release": {
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
[
"@semantic-release/exec",
{
"successCmd": "yarn run publish:github"
}
],
"@semantic-release/github"
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"main",
{
"name": "beta",
"prerelease": true
}
]
}
}

0 comments on commit 7050f43

Please sign in to comment.