Skip to content

Commit

Permalink
Workflow: provenance & stable publish
Browse files Browse the repository at this point in the history
  • Loading branch information
pakkographic committed Aug 13, 2024
1 parent f7c5869 commit a29ef91
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 6 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/dev-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ jobs:
publish:
runs-on: ubuntu-latest
needs: [lint, testing]
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
version: latest
- name: Checkout
uses: actions/checkout@v3

- name: Install Dependencies
run: npm i

- name: Set Version
run: |
git config user.email "<>"
Expand All @@ -40,6 +43,10 @@ jobs:
with:
token: ${{ secrets.NPM_TOKEN }}
tag: dev
- name: Publish
run: npm publish --tag dev --provenance --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Deprecate Old Versions
run: npx -y npm-deprecate
env:
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish Release
on:
workflow_dispatch:
release:
types: [released]

jobs:
lint:
name: ESLint
uses: ./.github/workflows/lint.yml

publish:
runs-on: ubuntu-latest
needs: [lint]
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/

- name: Install Dependencies
run: npm install

- name: Publish
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 1 addition & 2 deletions lib/structures/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1490,8 +1490,7 @@ export class Client extends TypedEmitter<ClientEvents> {
async getForumThreads(channelID: string, filter?: GetForumThreadsFilter): Promise<Array<ForumThread<ForumChannel>>> {
return this.rest.channels.getForumThreads(channelID, filter);
}
/** Get a cached guild, returns `undefined` if not cached.
*
/** Get a cached Guild, returns `undefined` if not cached.
* Note: this method doesn't send a rest request, it only returns cached entities.
*
* There is a similar method that uses REST to request the data
Expand Down

0 comments on commit a29ef91

Please sign in to comment.