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(infra): deploy with npm #403

Merged
merged 1 commit into from
Sep 12, 2024
Merged
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
53 changes: 25 additions & 28 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,45 @@
name: Release
on:
# manual trigger
workflow_dispatch:

on: workflow_dispatch # TODO set this on a deploy schedule

jobs:
deploy:
name: deploy
release:
name: Release
environment:
name: release
runs-on:
group: npm-deploy
environment:
name: deploy
permissions:
id-token: write
contents: write
id-token: write
contents: write
steps:
- name: Load secret
- name: Load Secrets
uses: 1password/load-secrets-action@581a835fb51b8e7ec56b71cf2ffddd7e68bb25e0
with:
# Export loaded secrets as environment variables
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
# You may need to change this to your vault name and secret name
# Refer to it by calling env.NPM_TOKEN
# This token is also limited by IP to ONLY work on the runner
NPM_TOKEN: op://npm-deploy/npm-runner-token/secret

- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744

uses: actions/checkout@v4
with:
submodules: "true"
fetch-depth: 2

- name: Setup Node
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7
uses: actions/setup-node@v4
with:
cache: yarn
node-version: 18

- name: Install dependencies
run: yarn install --immutable --immutable-cache

- name: Release
env:
NPM_CONFIG_USERCONFIG: /dev/null
YARN_NPM_AUTH_TOKEN: ${{ env.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn npm publish

registry-url: 'https://registry.npmjs.org'
# Defaults to the user or organization that owns the workflow file
scope: '@uniswap'

- name: Setup CI
run: npm ci

- name: Publish
run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ env.NPM_TOKEN }}
Loading