Skip to content

Commit

Permalink
add action
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Apr 24, 2024
1 parent b283574 commit 120ba2d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
42 changes: 22 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
push:
branches:
- main
- publish-to-jsr

jobs:
release:
name: Release
Expand Down Expand Up @@ -59,24 +61,24 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Notify discord
id: discord-msg
if: steps.changesets.outputs.published == 'true'
uses: ./.github/actions/discord-message
with:
publishedPackages: ${{ steps.changesets.outputs.publishedPackages }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
# - name: Notify discord
# id: discord-msg
# if: steps.changesets.outputs.published == 'true'
# uses: ./.github/actions/discord-message
# with:
# publishedPackages: ${{ steps.changesets.outputs.publishedPackages }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}

- name: Publish Prerelease
if: steps.changesets.outputs.published != 'true'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
git reset --hard origin/main
pnpm changeset version --no-git-tag --snapshot canary
pnpm changeset publish --no-git-tag --snapshot canary --tag canary
# - name: Publish Prerelease
# if: steps.changesets.outputs.published != 'true'
# env:
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
# git reset --hard origin/main
# pnpm changeset version --no-git-tag --snapshot canary
# pnpm changeset publish --no-git-tag --snapshot canary --tag canary
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"clean": "rimraf dist node_modules/.cache",
"prepublishOnly": "run-s clean build check test",
"prepare": "node ./scripts/prepare.js",
"changeset:version": "changeset version && pnpm install --lockfile-only && node ./scripts/jsr.js",
"changeset:publish": "changeset publish && jsr publish"
"changeset:version": "node ./scripts/jsr.js",
"changeset:publish": "jsr publish"
},
"repository": "https://github.com/0no-co/graphql.web",
"bugs": {
Expand Down

0 comments on commit 120ba2d

Please sign in to comment.