This repository has been archived by the owner on Jul 31, 2024. It is now read-only.
FLOW-856 | f-suggest and f-search Improvements (#121) #241
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: Test and Release | |
on: | |
push: | |
branches: | |
- main | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
publish_to_npm: | |
name: Publishing to npm registry | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Setup Node.js 18.x | |
uses: actions/[email protected] | |
with: | |
node-version: 18.x | |
- name: Install Dependencies | |
run: yarn | |
- name: Create Release Pull Request or Publish to npm | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
publish: yarn release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%B %d, %Y')" | |
- name: extract-changelogs | |
if: steps.changesets.outputs.published == 'true' | |
id: change-logs | |
uses: vikas-cldcvr/[email protected] | |
with: | |
released-package-versions: ${{ steps.changesets.outputs.publishedPackages }} | |
changelog-files-config: | | |
{ | |
"@cldcvr/flow-log":"packages/flow-log/CHANGELOG.md", | |
"@cldcvr/flow-code-editor":"packages/flow-code-editor/CHANGELOG.md", | |
"@cldcvr/flow-md-editor":"packages/flow-md-editor/CHANGELOG.md", | |
"@cldcvr/flow-core":"packages/flow-core/CHANGELOG.md", | |
"@cldcvr/flow-table":"packages/flow-table/CHANGELOG.md", | |
"@cldcvr/flow-core-config":"packages/flow-core-config/CHANGELOG.md" | |
} | |
- name: Send Slack Notification | |
if: steps.changesets.outputs.published == 'true' | |
id: slack | |
uses: slackapi/[email protected] | |
with: | |
# For posting a rich message using Block Kit | |
payload: | | |
{ | |
"text": "Updates", | |
"blocks": [ | |
{ | |
"type": "header", | |
"text": { | |
"type": "plain_text", | |
"text": ":mega: Flow Announcement" | |
} | |
}, | |
{ | |
"type": "context", | |
"elements": [ | |
{ | |
"text": "*${{ steps.date.outputs.date }}* | New Release Alert", | |
"type": "mrkdwn" | |
} | |
] | |
}, | |
{ | |
"type": "divider" | |
}, | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "Hello everyone!\nPlease find below the changelogs" | |
} | |
}, | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": ${{ toJSON(steps.change-logs.outputs.changeLogs) }} | |
} | |
} | |
] | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | |
publish_to_github: | |
name: Publishing to github registry | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: Setup Node.js 16.x | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16.x | |
- name: Install Dependencies | |
run: yarn | |
# Remove original publishConfig in packages/flow-core/package.json | |
- uses: sergeysova/jq-action@v2 | |
with: | |
cmd: echo "`jq '.publishConfig.registry="https://npm.pkg.github.com"' packages/flow-core/package.json`" > packages/flow-core/package.json | |
- uses: sergeysova/jq-action@v2 | |
with: | |
cmd: echo "`jq '.publishConfig.registry="https://npm.pkg.github.com"' packages/flow-log/package.json`" > packages/flow-log/package.json | |
- uses: sergeysova/jq-action@v2 | |
with: | |
cmd: echo "`jq '.publishConfig.registry="https://npm.pkg.github.com"' packages/flow-code-editor/package.json`" > packages/flow-code-editor/package.json | |
- uses: sergeysova/jq-action@v2 | |
with: | |
cmd: echo "`jq '.publishConfig.registry="https://npm.pkg.github.com"' packages/custom-elements-manifest-to-types/package.json`" > packages/custom-elements-manifest-to-types/package.json | |
- uses: sergeysova/jq-action@v2 | |
with: | |
cmd: echo "`jq '.publishConfig.registry="https://npm.pkg.github.com"' packages/flow-core-config/package.json`" > packages/flow-core-config/package.json | |
- uses: sergeysova/jq-action@v2 | |
with: | |
cmd: echo "`jq '.publishConfig.registry="https://npm.pkg.github.com"' packages/flow-table/package.json`" > packages/flow-table/package.json | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "16.x" | |
registry-url: "https://npm.pkg.github.com" | |
always-auth: true | |
scope: "@cldcvr" | |
- name: Creating .npmrc | |
run: | | |
cat << EOF > "$HOME/.npmrc" | |
//npm.pkg.github.com/:_authToken=$NPM_TOKEN | |
EOF | |
env: | |
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Release Pull Request or Publish to github | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
publish: yarn release --no-git-tag | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |