-
-
Notifications
You must be signed in to change notification settings - Fork 529
fix: move to trusted publishing #1551
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,96 +1,67 @@ | ||
| name: CI | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - v6 | ||
| - v7 | ||
| pull_request: | ||
| on: pull_request | ||
|
|
||
| jobs: | ||
| test-postgres: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| node-version: [10, 16] | ||
| node-version: [10, 24] | ||
| sequelize-version: [5, latest] | ||
| name: Postgres (Node ${{ matrix.node-version }}, Sequelize ${{ matrix.sequelize-version }}) | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| DIALECT: postgres | ||
| SEQ_PORT: 54320 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| - run: yarn install --frozen-lockfile --ignore-engines | ||
| - run: yarn add sequelize@${{ matrix.sequelize-version }} --ignore-engines | ||
| - run: if [ "${{ matrix.node-version }}" = "10" ]; then npm install -g npm@7; fi | ||
| - run: npm ci | ||
| - run: npm install sequelize@${{ matrix.sequelize-version }} | ||
| - run: docker compose up -d ${DIALECT} | ||
| - run: docker run --link ${DIALECT}:db --net cli_default jwilder/dockerize -wait tcp://${DIALECT}:${SEQ_PORT::-1} -timeout 2m | ||
| - run: yarn test | ||
| - run: npm test | ||
WikiRik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| test-mysql: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| node-version: [10, 16] | ||
| node-version: [10, 24] | ||
| sequelize-version: [5, latest] | ||
| name: MySQL (Node ${{ matrix.node-version }}, Sequelize ${{ matrix.sequelize-version }}) | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| DIALECT: mysql | ||
| SEQ_PORT: 33060 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| - run: yarn install --frozen-lockfile --ignore-engines | ||
| - run: yarn add sequelize@${{ matrix.sequelize-version }} --ignore-engines | ||
| - run: if [ "${{ matrix.node-version }}" = "10" ]; then npm install -g npm@7; fi | ||
| - run: npm ci | ||
| - run: npm install sequelize@${{ matrix.sequelize-version }} | ||
| - run: docker compose up -d ${DIALECT} | ||
| - run: docker run --link ${DIALECT}:db --net cli_default jwilder/dockerize -wait tcp://${DIALECT}:${SEQ_PORT::-1} -timeout 2m | ||
| - run: yarn test | ||
| - run: npm test | ||
| test-sqlite: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| node-version: [10, 16] | ||
| node-version: [10, 24] | ||
| sequelize-version: [5, latest] | ||
| name: SQLite (Node ${{ matrix.node-version }}, Sequelize ${{ matrix.sequelize-version }}) | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| DIALECT: sqlite | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| - run: yarn install --frozen-lockfile --ignore-engines | ||
| - run: yarn add sequelize@${{ matrix.sequelize-version }} --ignore-engines | ||
| - run: yarn test | ||
| release: | ||
| name: Release | ||
| runs-on: ubuntu-latest | ||
| needs: | ||
| [ | ||
| test-sqlite, | ||
| test-postgres, | ||
| test-mysql | ||
| ] | ||
| if: github.event_name == 'push' && (github.ref == 'refs/heads/v6' || github.ref == 'refs/heads/v7') | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 18.x | ||
| - run: yarn install --frozen-lockfile | ||
| - run: npx semantic-release | ||
| - id: sequelize | ||
| uses: sdepold/github-action-get-latest-release@master | ||
| with: | ||
| repository: sequelize/cli | ||
| - run: | | ||
| curl -XPOST -u "sdepold:${{ secrets.GH_TOKEN }}" -H "Accept: application/vnd.github.v3+json" -H "Content-Type: application/json" https://api.github.com/repos/sequelize/cli/dispatches --data '{"event_type":"Release notifier","client_payload":{"release-id": ${{ steps.sequelize.outputs.id }}}}' | ||
| - run: if [ "${{ matrix.node-version }}" = "10" ]; then npm install -g npm@7; fi | ||
| - run: npm ci | ||
| - run: npm install sequelize@${{ matrix.sequelize-version }} | ||
| - run: npm test | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| name: Release | ||
| on: workflow_dispatch | ||
|
|
||
| permissions: | ||
| contents: read # for checkout | ||
|
|
||
| jobs: | ||
| release: | ||
| name: Release | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write # to be able to publish a GitHub release | ||
| issues: write # to be able to comment on released issues | ||
| pull-requests: write # to be able to comment on released pull requests | ||
| id-token: write # to enable use of OIDC for trusted publishing and npm provenance | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 'lts/*' | ||
| - name: Install dependencies | ||
| run: npm clean-install | ||
| - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies | ||
| run: npm audit signatures | ||
| - name: Release | ||
| id: release | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: npm run release | ||
| - name: Post release notes to OpenCollective | ||
| if: steps.release.outputs.new_release_published == 'true' | ||
| env: | ||
| OPENCOLLECTIVE_TOKEN: ${{ secrets.OPEN_COLLECTIVE_KEY }} | ||
| OPENCOLLECTIVE_SLUG: sequelize | ||
| RELEASE_VERSION: ${{ steps.release.outputs.new_release_version }} | ||
| RELEASE_NOTES: ${{ steps.release.outputs.new_release_notes }} | ||
| PACKAGE_NAME: sequelize-cli | ||
| run: | | ||
| curl -X POST "https://api.opencollective.com/graphql/v2" \ | ||
WikiRik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| -H "Content-Type: application/json" \ | ||
| # TODO: use OAuth instead of Personal-Token so we can create the updates from the organization instead of a user | ||
WikiRik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| -H "Personal-Token: $OPENCOLLECTIVE_TOKEN" \ | ||
| -d "{ | ||
| \"query\": \"mutation CreateUpdate(\$update: UpdateCreateInput!) { createUpdate(update: \$update) { id legacyId slug title html publishedAt } }\", | ||
| \"variables\": { | ||
| \"update\": { | ||
| \"account\": { | ||
| \"slug\": \"$OPENCOLLECTIVE_SLUG\" | ||
| }, | ||
| \"title\": \"Release of $PACKAGE_NAME $RELEASE_VERSION\", | ||
| \"html\": \"<h2>Release of $PACKAGE_NAME $RELEASE_VERSION</h2><p>We've just released version $RELEASE_VERSION of $PACKAGE_NAME!</p><h3>Changes:</h3><pre>$RELEASE_NOTES</pre><p>Install it with: <code>npm install $PACKAGE_NAME@$RELEASE_VERSION</code></p>\", | ||
| \"isPrivate\": false, | ||
| \"notificationAudience\": \"ALL\" | ||
| } | ||
| } | ||
| }" | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,5 +27,5 @@ test/support/tmp/* | |
| !test/support/tmp/.gitkeep | ||
|
|
||
| # Extra files | ||
| package-lock.json | ||
| yarn.lock | ||
| npm-debug.log | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.