Skip to content

Commit

Permalink
Moves all CI to GitHub Actions (#610)
Browse files Browse the repository at this point in the history
- Adds the remaining steps to GitHub Actions: `lint`, `build`, and
`publish`. There is a slight change in that we now always run the `lint`
and `build` steps
- We also now perform the `lint`, `build`, and `publish` steps using the
Node version in `.nvmrc`, rather than explicitly using Node 14 as we did
in CircleCI
- Removes the CircleCI configuration

Once approved, I'll disable CircleCI prior to merging.
  • Loading branch information
vlj91 authored May 17, 2024
1 parent 5605a1a commit 6d9af54
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 143 deletions.
139 changes: 0 additions & 139 deletions .circleci/config.yml

This file was deleted.

81 changes: 78 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ on:
push:
branches:
- master
tags:
- 'v*.*.*'
release:
types: [published]

jobs:
test:
name: "test-node-${{ matrix.node-version }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [14, 16, 18, 20]
steps:
Expand All @@ -25,7 +26,6 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile
Expand All @@ -47,3 +47,78 @@ jobs:
uses: test-summary/action@v2
with:
paths: ./test-reports/jest/results.xml

lint:
name: "lint"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run prettier
run: yarn lint:check

build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- run: yarn build
- run: npm link
- run: npx proxay --help
- run: |
npx proxay -m record -h https://www.google.com -t tapes/ &
# Wait until it loads.
until (curl http://localhost:3000 2>&1 | grep Google &>/dev/null)
do
echo "Waiting until server ready..."
sleep 5
done
publish:
runs-on: ubuntu-latest
if: github.event_name == 'release'
needs:
- test
- build
- lint
env:
# Used in setup-node and publish steps
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: yarn install --frozen-lockfile

- run: yarn build

- name: Publish to npm registry
run: npm publish --provenance --access public
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ To release a new version of Proxay, follow the following two steps:

1. Visit the [releases page](https://github.com/airtasker/proxay/releases) to see what was last announced.
2. Draft a new release:
- Tag = `v[version]` (e.g. `v2.1.1`). **Do not forget the `v`, which is required to trigger the NPM publish on CircleCI.**
- Tag = `v[version]` (e.g. `v2.1.1`). **Do not forget the `v`, which is required to trigger the NPM publish in GitHub Actions.**
- Title = `Release v[version]` (e.g. `Release v2.1.1`)
3. Make sure to announce major changes since the last version in the description.
4. Once published, [check CircleCI](https://circleci.com/gh/airtasker/proxay) to ensure publication was successful.

0 comments on commit 6d9af54

Please sign in to comment.