-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update prerelease workflow to tag latest prerelease with next …
…npm tag on publish (#11226)
- Loading branch information
Showing
1 changed file
with
6 additions
and
35 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,17 +65,6 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get package version from package.json | ||
id: package-version | ||
uses: martinbeentjes/npm-get-version-action@main | ||
|
||
- name: Get npm tag from pre.json | ||
id: tag | ||
uses: notiz-dev/[email protected] | ||
with: | ||
path: ".changeset/pre.json" | ||
prop_path: "tag" | ||
|
||
- name: Publish to npm + GitHub | ||
id: changesets | ||
# Only run publish if we're still in pre mode and the last commit was | ||
|
@@ -84,11 +73,15 @@ jobs: | |
uses: changesets/action@v1 | ||
with: | ||
version: echo "This step should never version" | ||
publish: npm run changeset-publish -- --tag next # by default, this will publish to npm and GitHub | ||
publish: npm run changeset-publish # by default, this will publish to npm and GitHub | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Tag release with next on npm | ||
if: steps.changesets.outcome == 'success' | ||
run: npm dist-tag add @apollo/client@${{ fromJson(steps.changesets.outputs.publishedPackages)[0].version }} next | ||
|
||
- name: Send a Slack notification on publish | ||
if: steps.changesets.outcome == 'success' | ||
id: slack | ||
|
@@ -99,37 +92,15 @@ jobs: | |
# You can pass in multiple channels to post to by providing | ||
# a comma-delimited list of channel IDs | ||
channel-id: "C01PS0CB41G" | ||
# For posting a simple plain text message | ||
payload: | | ||
{ | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "A new version of `@apollo/client` was released :rocket:" | ||
"text": "A new version of `@apollo/client` was released: <https://github.com/apollographql/apollo-client/releases/tag/v${{ fromJson(steps.changesets.outputs.publishedPackages)[0].version }}|v${{ fromJson(steps.changesets.outputs.publishedPackages)[0].version }}> :rocket:" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Version:*\n`${{ steps.package-version.outputs.current-version}}`" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Tag:*\n`${{steps.tag.outputs.prop}}`" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*GitHub release:*\nN/A" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*npm releases:*\n<https://www.npmjs.com/package/@apollo/client?activeTab=versions|link>" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|