chore(deps): update cimg/node docker tag to v23.3.0 (#1577) #445
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
name: Release | |
on: | |
push: | |
branches: | |
- main | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
release: | |
name: Changesets Release | |
# Prevents action from creating a PR on forks | |
if: github.repository == 'apollographql/apollo-client-devtools' | |
runs-on: ubuntu-latest | |
# Permissions necessary for Changesets to push a new branch and open PRs | |
# (for automated Version Packages PRs), and request the JWT for provenance. | |
# More info: https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#adding-permissions-settings | |
permissions: | |
contents: write | |
pull-requests: write | |
id-token: write | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
# Fetch entire git history so Changesets can generate changelogs | |
# with the correct commits | |
fetch-depth: 0 | |
- name: Check for pre.json file existence | |
id: check_files | |
uses: andstor/[email protected] | |
with: | |
files: ".changeset/pre.json" | |
- name: Append NPM token to .npmrc | |
run: | | |
cat << EOF > "$HOME/.npmrc" | |
//registry.npmjs.org/:_authToken=$NPM_TOKEN | |
EOF | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Setup Node.js 20.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Install dependencies | |
run: npm ci | |
# Publishes with manifest v2 | |
- name: Create release PR or publish to npm + GitHub | |
id: changesets | |
if: steps.check_files.outputs.files_exists == 'false' | |
uses: changesets/action@v1 | |
with: | |
version: npm run changeset-version | |
publish: npm run changeset-publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Create chrome zip file | |
if: steps.changesets.outcome == 'success' && steps.changesets.outputs.published == 'true' | |
run: npm run dist:chrome | |
- name: Upload & release Chrome extension | |
if: steps.changesets.outcome == 'success' && steps.changesets.outputs.published == 'true' | |
uses: mnao305/[email protected] | |
with: | |
file-path: apollo-client-devtools-chrome.zip | |
extension-id: ${{ secrets.CHROME_EXTENSION_ID }} | |
client-id: ${{ secrets.CHROME_CLIENT_ID }} | |
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }} | |
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }} | |
- name: Create firefox zip files | |
if: steps.changesets.outcome == 'success' && steps.changesets.outputs.published == 'true' | |
run: npm run dist:firefox | |
- name: Publish the extension for Firefox | |
if: steps.changesets.outcome == 'success' && steps.changesets.outputs.published == 'true' | |
uses: yayuyokitano/[email protected] | |
with: | |
xpi_path: apollo-client-devtools-firefox.zip | |
src_path: apollo-client-devtools-src.zip | |
api_key: ${{ secrets.FIREFOX_API_KEY }} | |
api_secret: ${{ secrets.FIREFOX_API_SECRET }} | |
guid: ${{ secrets.FIREFOX_ADDON_UUID }} | |
- name: Send a Slack notification on publish | |
if: steps.changesets.outcome == 'success' && steps.changesets.outputs.published == 'true' | |
id: slack | |
uses: slackapi/[email protected] | |
with: | |
# Slack channel id, channel name, or user id to post message | |
# See also: https://api.slack.com/methods/chat.postMessage#channels | |
# You can pass in multiple channels to post to by providing | |
# a comma-delimited list of channel IDs | |
channel-id: "C01GC140SUV" | |
payload: | | |
{ | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "A new version of `apollo-client-devtools` was released: <https://github.com/apollographql/apollo-client-devtools/releases/tag/v${{ fromJson(steps.changesets.outputs.publishedPackages)[0].version }}|v${{ fromJson(steps.changesets.outputs.publishedPackages)[0].version }}> :rocket:" | |
} | |
} | |
] | |
} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |