Skip to content

Commit

Permalink
Add preview publishing (#151)
Browse files Browse the repository at this point in the history
* fix `repository` tag

* add ci

* set corepack version to 3

* temporarily disable other CI

* back to v3

* bump checkout to v4

* refactor

* fix structure

* bump everything to v4

* enable compact mode

* only run if CI is successful

* Revert "only run if CI is successful"

This reverts commit 55a0af1.

* enable other workflows

* integrated release.yml into ci.yml

* fix preview steps

* fix preview steps

* bump actions versions

* test reusable jobs setup

* set cache

* cache node

* revert reusable jobs
  • Loading branch information
arobsn authored Oct 25, 2024
1 parent 63be464 commit d12291d
Show file tree
Hide file tree
Showing 14 changed files with 74 additions and 38 deletions.
68 changes: 51 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: CI

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
push:
branches:
- "master"
tags:
- "!**"

concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -16,13 +18,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 9

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
Expand All @@ -34,13 +36,13 @@ jobs:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 9

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
Expand All @@ -57,14 +59,14 @@ jobs:
matrix:
node-version: [18, 20]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 9

- name: Build and test using Node.js v${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
Expand All @@ -82,9 +84,9 @@ jobs:
matrix:
bun-version: ["latest"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 9

Expand All @@ -104,14 +106,14 @@ jobs:
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 9

- name: Build using Node.js v20
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
Expand All @@ -124,3 +126,35 @@ jobs:

- name: Test using edge-runtime
run: pnpm run test:unit-edge

publish-preview:
name: "Publish preview"
runs-on: ubuntu-latest
needs: build-and-test-node
if: success()
timeout-minutes: 20
strategy:
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Enable corepack
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

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

- name: Build
run: pnpm -r build

- name: Publish
run: pnpx pkg-pr-new publish './packages/*' './plugins/*' --no-template --pnpm --compact
16 changes: 9 additions & 7 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
name: Coverage

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
push:
branches:
- "master"
tags:
- "!**"

jobs:
coverage:
name: Check and submit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 9

- name: Collect coverage
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
Expand All @@ -28,7 +30,7 @@ jobs:

- name: Submit report
if: success() || failure()
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage-final.json
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ jobs:

steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 9

- name: Setup Node.js 20.x
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": "true",
"repository": "fleet-sdk/fleet",
"repository": "github:fleet-sdk/fleet",
"license": "MIT",
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/blockchain-providers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
},
"sideEffects": false,
"repository": "fleet-sdk/fleet",
"repository": "github:fleet-sdk/fleet",
"license": "MIT",
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
},
"sideEffects": false,
"repository": "fleet-sdk/fleet",
"repository": "github:fleet-sdk/fleet",
"license": "MIT",
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
},
"sideEffects": false,
"repository": "fleet-sdk/fleet",
"repository": "github:fleet-sdk/fleet",
"license": "MIT",
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
},
"sideEffects": false,
"repository": "fleet-sdk/fleet",
"repository": "github:fleet-sdk/fleet",
"license": "MIT",
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion packages/crypto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
},
"sideEffects": false,
"repository": "fleet-sdk/fleet",
"repository": "github:fleet-sdk/fleet",
"license": "MIT",
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion packages/mock-chain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
},
"sideEffects": false,
"repository": "fleet-sdk/fleet",
"repository": "github:fleet-sdk/fleet",
"license": "MIT",
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion packages/serializer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
},
"sideEffects": false,
"repository": "fleet-sdk/fleet",
"repository": "github:fleet-sdk/fleet",
"license": "MIT",
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
},
"sideEffects": false,
"repository": "fleet-sdk/fleet",
"repository": "github:fleet-sdk/fleet",
"license": "MIT",
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion plugins/ageusd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
},
"sideEffects": false,
"repository": "fleet-sdk/fleet",
"repository": "github:fleet-sdk/fleet",
"license": "MIT",
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion plugins/babel-fees/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
},
"sideEffects": false,
"repository": "fleet-sdk/fleet",
"repository": "github:fleet-sdk/fleet",
"license": "MIT",
"publishConfig": {
"access": "public",
Expand Down

0 comments on commit d12291d

Please sign in to comment.