Skip to content

Commit 6d9af54

Browse files
authored
Moves all CI to GitHub Actions (#610)
- 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.
1 parent 5605a1a commit 6d9af54

File tree

3 files changed

+79
-143
lines changed

3 files changed

+79
-143
lines changed

.circleci/config.yml

-139
This file was deleted.

.github/workflows/ci.yml

+78-3
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ on:
77
push:
88
branches:
99
- master
10-
tags:
11-
- 'v*.*.*'
10+
release:
11+
types: [published]
1212

1313
jobs:
1414
test:
1515
name: "test-node-${{ matrix.node-version }}"
1616
runs-on: ubuntu-latest
1717
strategy:
18+
fail-fast: false
1819
matrix:
1920
node-version: [14, 16, 18, 20]
2021
steps:
@@ -25,7 +26,6 @@ jobs:
2526
uses: actions/setup-node@v4
2627
with:
2728
node-version: ${{ matrix.node-version }}
28-
cache: 'yarn'
2929

3030
- name: Install dependencies
3131
run: yarn install --frozen-lockfile
@@ -47,3 +47,78 @@ jobs:
4747
uses: test-summary/action@v2
4848
with:
4949
paths: ./test-reports/jest/results.xml
50+
51+
lint:
52+
name: "lint"
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v4
57+
58+
- name: Setup NodeJS
59+
uses: actions/setup-node@v4
60+
with:
61+
node-version-file: .nvmrc
62+
cache: 'yarn'
63+
64+
- name: Install dependencies
65+
run: yarn install --frozen-lockfile
66+
67+
- name: Run prettier
68+
run: yarn lint:check
69+
70+
build:
71+
runs-on: ubuntu-latest
72+
steps:
73+
- name: Checkout
74+
uses: actions/checkout@v4
75+
76+
- name: Setup NodeJS
77+
uses: actions/setup-node@v4
78+
with:
79+
node-version-file: .nvmrc
80+
cache: 'yarn'
81+
82+
- name: Install dependencies
83+
run: yarn install --frozen-lockfile
84+
85+
- run: yarn build
86+
- run: npm link
87+
- run: npx proxay --help
88+
- run: |
89+
npx proxay -m record -h https://www.google.com -t tapes/ &
90+
# Wait until it loads.
91+
until (curl http://localhost:3000 2>&1 | grep Google &>/dev/null)
92+
do
93+
echo "Waiting until server ready..."
94+
sleep 5
95+
done
96+
97+
publish:
98+
runs-on: ubuntu-latest
99+
if: github.event_name == 'release'
100+
needs:
101+
- test
102+
- build
103+
- lint
104+
env:
105+
# Used in setup-node and publish steps
106+
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}
107+
steps:
108+
- name: Checkout
109+
uses: actions/checkout@v4
110+
111+
- name: Setup NodeJS
112+
uses: actions/setup-node@v4
113+
with:
114+
node-version-file: .nvmrc
115+
cache: 'yarn'
116+
registry-url: 'https://registry.npmjs.org'
117+
118+
- name: Install dependencies
119+
run: yarn install --frozen-lockfile
120+
121+
- run: yarn build
122+
123+
- name: Publish to npm registry
124+
run: npm publish --provenance --access public

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ To release a new version of Proxay, follow the following two steps:
156156

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

0 commit comments

Comments
 (0)