chore(release): publish #279
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
if: > | |
${{!contains(github.event.head_commit.message, format('chore(release){0} publish', ':')) | |
&& !contains(github.event.head_commit.message, format('CI{0} Update yarn.lock files', ':'))}} | |
permissions: | |
contents: write | |
packages: write | |
actions: read | |
id-token: write | |
steps: | |
- uses: actions/create-github-app-token@v1 | |
id: app-token | |
with: | |
app-id: ${{ vars.VERSION_BUMPER_APPID }} | |
private-key: ${{ secrets.VERSION_BUMPER_SECRET }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ steps.app-token.outputs.token }} | |
- name: Set up Git user | |
run: | | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git config --global user.name "${GITHUB_ACTOR}" | |
- name: Install Dependencies with Immutable Flag | |
run: | | |
yarn install --immutable | |
- run: npx nx reset | |
- run: rm -rf node_modules/.cache/rollup-plugin-typescript2 | |
- name: Build and Test | |
env: | |
SDK_JUSTANAME_TEST_API_KEY: ${{ secrets.SDK_JUSTANAME_TEST_API_KEY }} | |
SDK_MAPP_PRIVATE_KEY: ${{ secrets.SDK_MAPP_PRIVATE_KEY }} | |
SDK_SEPOLIA_PROVIDER_URL: ${{ secrets.SDK_SEPOLIA_PROVIDER_URL }} | |
SDK_MAINNET_PROVIDER_URL: ${{ secrets.SDK_MAINNET_PROVIDER_URL }} | |
SDK_ENS_DOMAIN: ${{ secrets.SDK_ENS_DOMAIN }} | |
SDK_MAPP: ${{ secrets.SDK_MAPP }} | |
SDK_CHAIN_ID: ${{ secrets.SDK_CHAIN_ID }} | |
SDK_JUSTANAME_DEV: ${{ secrets.SDK_JUSTANAME_DEV }} | |
SIWENS_PRIVATE_KEY: ${{ secrets.SIWENS_PRIVATE_KEY }} | |
SIWENS_PROVIDER_URL: ${{ secrets.SIWENS_PROVIDER_URL }} | |
SIWENS_VALID_ENS: ${{ secrets.SIWENS_VALID_ENS }} | |
run: | | |
npx nx affected -t test --configuration=ci --passWithNoTests --exclude=justaname-mono-sdk,console --parallel=1 | |
- name: Pull latest changes from main | |
run: git pull origin main | |
- name: Setup Node.js with npm Registry | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 'lts/*' | |
registry-url: 'https://registry.npmjs.org' | |
always-auth: true | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- run: rm -rf node_modules/.cache/rollup-plugin-typescript2 | |
- name: Release | |
run: | | |
npx nx release --specifier=patch --yes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NPM_CONFIG_PROVENANCE: true |