-
Notifications
You must be signed in to change notification settings - Fork 119
83 lines (82 loc) · 2.93 KB
/
w3.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: w3 cli
on:
push:
branches:
- main
paths:
- 'packages/w3/**'
- '.github/workflows/w3.yml'
- 'package-lock.json'
pull_request:
branches:
- main
paths:
- 'packages/w3/**'
- '.github/workflows/w3.yml'
- 'package-lock.json'
jobs:
test:
runs-on: ubuntu-latest
name: Test
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
# Only install the deps directly listed... dont do workspace magic.
# Running install from the root gets you all the deps for all the packages.
# which can easily mask missing deps if another modules also depends on it.
- run: npm install
working-directory: packages/w3
- run: npm test
working-directory: packages/w3
test-e2e:
runs-on: ubuntu-latest
name: Test e2e
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
# Use workspace deps here to test the workspace version of the client against the staging api.
# We want this one to fail if we can't upload to the staging api using the workspace version of the client.
- uses: bahmutov/npm-install@v1
- name: Test upload to staging
# disabled until we can make this succeed while staging is in maintenance mode
# as part of old.web3.storage sunset
continue-on-error: true
run: |
npm run build -w packages/client
echo "$(date --utc --iso-8601=seconds) web3.storage upload test" > ./upload-test-small
./packages/w3/bin.js put ./upload-test-small --api https://api-staging.web3.storage --token ${{ secrets.STAGING_WEB3_TOKEN }}
release:
name: Release
runs-on: ubuntu-latest
needs:
- test
- test-e2e
steps:
- uses: GoogleCloudPlatform/release-please-action@v3
id: tag-release
with:
path: packages/w3
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
monorepo-tags: true
package-name: w3
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Other Changes","hidden":false}]'
- uses: actions/checkout@v2
if: ${{ steps.tag-release.outputs.releases_created }}
- uses: actions/setup-node@v2
if: ${{ steps.tag-release.outputs.releases_created }}
with:
node-version: '16'
registry-url: https://registry.npmjs.org/
- uses: bahmutov/npm-install@v1
if: ${{ steps.tag-release.outputs.releases_created }}
# --- w3 cli deploy steps ---------------------------------------------
- name: w3 cli - NPM Publish
if: ${{ steps.tag-release.outputs.releases_created }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
run: npm publish --workspace packages/w3