Skip to content

Commit

Permalink
update release.yml for prerelease
Browse files Browse the repository at this point in the history
  • Loading branch information
storywithoutend committed Jan 7, 2025
1 parent 8890de9 commit a9c1192
Showing 1 changed file with 35 additions and 40 deletions.
75 changes: 35 additions & 40 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,53 @@ name: Prerelease
on:
release:
types: [published]

defaults:
run:
shell: bash

env:
FORCE_COLOR: true

jobs:
changelog:
name: PR or Release
if: ${{ github.repository_owner == 'ensdomains' }}
runs-on: ubuntu-latest
release:
name: Release
permissions:
contents: write
id-token: write
pull-requests: write
contents: write
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}

- uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable pnpm
- uses: pnpm/action-setup@v4
with:
version: 9.4.0

- uses: actions/setup-node@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
node-version: 18
registry-url: 'https://registry.npmjs.org'

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

- name: Build Packages
run: pnpm -r build
- name: Set up git
run: |
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'
git config --local user.name 'github-actions[bot]'
- name: Fix npmrc
run: npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Bump version to ${{ github.event.release.tag_name }}
run: |
pnpm -F @ensdomains/ensjs ver ${{ github.event.release.tag_name }}
git add .
git commit -m "${{ github.event.release.tag_name }}"
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
# Note: pnpm install after versioning is necessary to refresh lockfile
version: pnpm chgset:version:prerelease
publish: pnpm release --no-git-checks
commit: "chore: release"
title: "[ci] release"
- name: Publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Needs access to publish to npm
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
run: |
pnpm config set //registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}
pnpm -F @ensdomains/ensjs publish --tag next --no-git-checks
- name: Push changes
run: git push
env:
github-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit a9c1192

Please sign in to comment.