Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: release-please for db #1577

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 43 additions & 17 deletions .github/workflows/db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
paths:
- 'packages/db/**'
- '.github/workflows/db.yml'

# Nothing to do on PR yet, but having the check appear on the PR serves as a reminder
# that we don't have proper tests for db changes yet, and that merging it will deploy.
pull_request:
paths:
- 'packages/db/**'
Expand All @@ -34,20 +31,49 @@ jobs:
DAG_CARGO_USER: ${{secrets.DAG_CARGO_USER}}
DAG_CARGO_PASSWORD: ${{secrets.DAG_CARGO_PASSWORD}}

deploy-staging:
name: Deploy Staging DB
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# this doesn't *do* anything, so commenting out until we can actually deploy to staging db from CI.
# deploy-staging:
# name: Deploy Staging DB
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v2
# with:
# node-version: 16
# - uses: bahmutov/npm-install@v1
# # TODO: fork prod db
# # TODO: Update staging schema!!!
# - name: Test upload to staging
# 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we check for if: github.event_name == 'push' && github.ref == 'refs/heads/main' like commented above?

runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: GoogleCloudPlatform/release-please-action@v3
id: tag-release
with:
node-version: 16
- uses: bahmutov/npm-install@v1
# TODO: Update schema on changes
# - name: Update Postgres resources
- name: Test upload to staging
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 }}
path: packages/db
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
monorepo-tags: true
package-name: db
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Other Changes","hidden":false}]'
# --- DB deploy steps ---------------------------------------------------
# - 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 }}

# TODO: snapshot prod db
# TODO: Update prod schema!!!