diff --git a/.github/workflows/multi-platform.yml b/.github/workflows/multi-platform.yml index f9861dbc0..f6f6fdddd 100644 --- a/.github/workflows/multi-platform.yml +++ b/.github/workflows/multi-platform.yml @@ -1,4 +1,5 @@ name: Multi-Platform Build and Release + on: release: types: [published] @@ -9,76 +10,69 @@ on: - 'master' paths-ignore: - 'docs/**' - # - '.github/**' workflow_dispatch: inputs: release-ver: - description: 'Stable Release Version' - required: true - default: 'v' + description: 'Stable Release Version' + required: true + default: 'v' stripped-release-ver: - description: 'Stripped Stable Release Version' - required: true - default: '' + description: 'Stripped Stable Release Version' + required: true + default: '' release-channel: - description: 'Release Channel' - required: true - default: 'edge' + description: 'Release Channel' + required: true + default: 'edge' env: - GIT_VERSION: ${{github.event.inputs.release-ver}} - GIT_STRIPPED_VERSION: ${{github.event.inputs.stripped-release-ver}} - RELEASE_CHANNEL: ${{github.event.inputs.release-channel}} + GIT_VERSION: ${{ github.event.inputs.release-ver }} + GIT_STRIPPED_VERSION: ${{ github.event.inputs.stripped-release-ver }} + RELEASE_CHANNEL: ${{ github.event.inputs.release-channel }} GIT_TAG: ${{ github.event.release.tag_name }} jobs: print-inputs: runs-on: ubuntu-latest steps: + - run: | + echo "Dispatched GIT_VERSION: ${{ github.event.inputs.release-ver }}" + echo "Dispatched GIT_STRIPPED_VERSION: ${{ github.event.inputs.stripped-release-ver }}" + echo "Env RELEASE_CHANNEL: ${{ env.RELEASE_CHANNEL }}" + echo "Env GIT_VERSION: ${{ env.GIT_VERSION }}" + echo "Env GIT_STRIPPED_VERSION: ${{ env.GIT_STRIPPED_VERSION }}" + echo "Env GIT_TAG: ${{ github.event.release.tag_name }}" - - run: | - echo "Dispatched GIT_VERSION: ${{github.event.inputs.release-ver}}" - echo " Dispatched GIT_STRIPPED_VERSION: ${{github.event.inputs.stripped-release-ver}}" - echo "Env RELEASE_CHANNEL: ${{env.RELEASE_CHANNEL}}" - echo "Env GIT_VERSION: ${{env.GIT_VERSION}}" - echo "Env GIT_STRIPPED_VERSION: ${{env.GIT_STRIPPED_VERSION}}" - echo "Env GIT_TAG: ${{ github.event.release.tag_name }}" - docker-build: runs-on: ubuntu-latest steps: - - - name: Checkout repo + - name: Checkout repo uses: actions/checkout@v3 - - - name: Identify Release Values - if: "${{ github.event.inputs.release-ver}} != 'v' }}" + + - name: Identify Release Values + if: github.event.inputs.release-ver != 'v' run: | - # GIT_REF=`git symbolic-ref HEAD` - if [[ $GIT_TAG = refs/tags* ]] - then - echo RELEASE_CHANNEL=stable >> $GITHUB_ENV + if [[ $GIT_TAG == refs/tags* ]]; then + echo "RELEASE_CHANNEL=stable" >> $GITHUB_ENV else - echo RELEASE_CHANNEL=edge >> $GITHUB_ENV + echo "RELEASE_CHANNEL=edge" >> $GITHUB_ENV fi + echo "Release channel determined to be $RELEASE_CHANNEL" - LATEST_VERSION=$(git ls-remote --tags | tail -1 | cut -f2 | sed 's/refs\/tags\///g') >> $GITHUB_ENV - GIT_VERSION=$(git ls-remote --tags | tail -1 | cut -f2 | sed 's/refs\/tags\///g') >> $GITHUB_ENV - # GIT_VERSION=$(git describe --tags `git rev-list --tags --max-count=1` --always) - GIT_STRIPPED_VERSION=$(git ls-remote --tags | tail -1 | cut -f2 | sed 's/refs\/tags\///g' | cut -c2-) + LATEST_VERSION=$(git ls-remote --tags | tail -1 | cut -f2 | sed 's/refs\/tags\///g') echo "GIT_LATEST=$LATEST_VERSION" >> $GITHUB_ENV - echo "GIT_VERSION=$GIT_VERSION" >> $GITHUB_ENV + echo "GIT_VERSION=$LATEST_VERSION" >> $GITHUB_ENV + GIT_STRIPPED_VERSION=$(echo $LATEST_VERSION | cut -c2-) echo "GIT_STRIPPED_VERSION=$GIT_STRIPPED_VERSION" >> $GITHUB_ENV shell: bash - - - name: Set up QEMU + - name: Set up QEMU uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx + + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - - name: Docker Meta + + - name: Docker Meta id: meta uses: docker/metadata-action@v3 with: @@ -86,35 +80,35 @@ jobs: flavor: | latest=false tags: | - type=raw,value=${{env.RELEASE_CHANNEL}}-{{sha}} - type=semver,pattern={{version}},value=${{env.GIT_STRIPPED_VERSION}} - type=raw,pattern={{version}},value=${{env.RELEASE_CHANNEL}}-${{env.GIT_VERSION}} - type=raw,value=${{env.RELEASE_CHANNEL}}-{{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} - type=raw,value=${{env.RELEASE_CHANNEL}}-latest - type=semver,pattern={{version}},value=${{env.RELEASE_CHANNEL}}-${{env.GIT_VERSION}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} - - - name: Login to DockerHub + type=raw,value=${{ env.RELEASE_CHANNEL }}-{{sha}} + type=semver,pattern={{version}},value=${{ env.GIT_STRIPPED_VERSION }} + type=raw,pattern={{version}},value=${{ env.RELEASE_CHANNEL }}-${{ env.GIT_VERSION }} + type=raw,value=${{ env.RELEASE_CHANNEL }}-{{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} + type=raw,value=${{ env.RELEASE_CHANNEL }}-latest + type=semver,pattern={{version}},value=${{ env.RELEASE_CHANNEL }}-${{ env.GIT_VERSION }},enable=${{ startsWith(github.ref, 'refs/tags/v') }} + + - name: Login to DockerHub uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and Push + + - name: Build and Push uses: docker/build-push-action@v2 with: - context: "{{defaultContext}}" + context: . push: true build-args: | - GIT_STRIPPED_VERSION=${{env.GIT_STRIPPED_VERSION}} - GIT_VERSION=${{env.GIT_VERSION}} - RELEASE_CHANNEL=${{env.RELEASE_CHANNEL}} + GIT_STRIPPED_VERSION=${{ env.GIT_STRIPPED_VERSION }} + GIT_VERSION=${{ env.GIT_VERSION }} + RELEASE_CHANNEL=${{ env.RELEASE_CHANNEL }} tags: ${{ steps.meta.outputs.tags }} platforms: linux/amd64,linux/arm64 - - - name: Docker Hub Description + + - name: Docker Hub Description uses: peter-evans/dockerhub-description@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} repository: meshery/meshery-docker-extension - readme-filepath: /install/docker-extension/README.md + readme-filepath: install/docker-extension/README.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 25a41430e..a17939497 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,11 +1,9 @@ -# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created -# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages - name: Publish Node.js Package on: release: types: [published] + env: HUSKY: 0 @@ -36,14 +34,16 @@ jobs: - uses: actions/setup-node@v3 with: node-version: '20.x' - registry-url: "https://registry.npmjs.org" + registry-url: "https://npm.pkg.github.com" # ✅ Updated for GitHub Packages scope: "@layer5" + - run: | npm install npm run build npm publish --verbose env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # ✅ Use GitHub token for authentication + versions-check: needs: publish-gpr runs-on: ubuntu-latest @@ -53,19 +53,19 @@ jobs: with: result-encoding: string script: | - let str = `${{github.event.release.tag_name}}` + let str = `${{ github.event.release.tag_name }}` + return str.replace(/^v/, '') # ✅ Ensure correct version format - return str.replace(/^v/, '') - name: Save Release number if: ${{ !cancelled() }} run: | mkdir -p ./version echo ${{ steps.versions.outputs.result }} > ./version/number + - name: Upload Version Report if: ${{ !cancelled() }} - uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 + uses: actions/upload-artifact@v4 with: name: version-number - path: | - version/number - retention-days: 14 \ No newline at end of file + path: version/number + retention-days: 14 diff --git a/.github/workflows/slack.yml b/.github/workflows/slack.yml index 7b556b3ea..f54bbc620 100644 --- a/.github/workflows/slack.yml +++ b/.github/workflows/slack.yml @@ -1,31 +1,34 @@ name: Slack Notify on: watch: + types: [started] issues: - types: [started] + types: [labeled] # Triggers when a label is added to an issue + jobs: star-notify: if: github.event_name == 'watch' - name: Notify Slack on star + name: Notify Slack on Star runs-on: ubuntu-latest steps: - - name: Get current star count - run: | - echo "STARS=$(curl --silent 'https://api.github.com/repos/${{github.repository}}' -H 'Accept: application/vnd.github.preview' | jq '.stargazers_count')" >> $GITHUB_ENV - - name: Notify slack - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - uses: pullreminders/slack-action@master - with: - args: '{\"channel\":\"CSK7N9TGX\",\"text\":\"${{ github.actor }} just starred ${{github.repository}}! (https://github.com/${{github.repository}}/stargazers) Total ⭐️: ${{env.STARS}}\"}' + - name: Get current star count + run: | + echo "STARS=$(curl --silent 'https://api.github.com/repos/${{ github.repository }}' -H 'Accept: application/vnd.github.preview' | jq '.stargazers_count')" >> $GITHUB_ENV + - name: Notify Slack + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + uses: rtCamp/action-slack-notify@v2 + with: + args: '{"channel":"CSK7N9TGX","text":"${{ github.actor }} just starred ${{ github.repository }}! (https://github.com/${{ github.repository }}/stargazers) Total ⭐️: ${{ env.STARS }}"}' + good-first-issue-notify: - if: github.event_name == 'issues' && github.event.label.name == 'good first issue' || github.event.label.name == 'first-timers-only' - name: Notify Slack for new good-first-issue + if: github.event_name == 'issues' && (github.event.label.name == 'good first issue' || github.event.label.name == 'first-timers-only') + name: Notify Slack for Good First Issue runs-on: ubuntu-latest steps: - - name: Notify slack + - name: Notify Slack env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - uses: pullreminders/slack-action@master + uses: rtCamp/action-slack-notify@v2 with: - args: '{\"channel\":\"C019426UBNY\",\"text\":\"A good first issue label was just added to ${{github.event.issue.html_url}}.\"}' + args: '{"channel":"C019426UBNY","text":"A good first issue label was just added to ${{ github.event.issue.html_url }}."}' diff --git a/.husky/commit-msg b/.husky/commit-msg deleted file mode 100755 index 0a4b97de5..000000000 --- a/.husky/commit-msg +++ /dev/null @@ -1 +0,0 @@ -npx --no -- commitlint --edit $1 diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index d0a778429..000000000 --- a/.husky/pre-commit +++ /dev/null @@ -1 +0,0 @@ -npx lint-staged \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4040b9698..a42fbefda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3590,26 +3590,6 @@ "dev": true, "license": "ISC" }, - "node_modules/@xstate/react": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@xstate/react/-/react-5.0.2.tgz", - "integrity": "sha512-x5GOrE0ZYjU2ba986u0CCp7SaPwzElSn1SW0mZ9MuBgsZ+BW7vTLVOvGmURynwojdso8d6nVbK3c2+MRVqGVgA==", - "license": "MIT", - "peer": true, - "dependencies": { - "use-isomorphic-layout-effect": "^1.1.2", - "use-sync-external-store": "^1.2.0" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-0", - "xstate": "^5.19.2" - }, - "peerDependenciesMeta": { - "xstate": { - "optional": true - } - } - }, "node_modules/abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", @@ -12780,19 +12760,6 @@ "react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, - "node_modules/react": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", - "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "loose-envify": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/react-display-name": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/react-display-name/-/react-display-name-0.2.5.tgz", @@ -12827,20 +12794,6 @@ "dnd-core": "^11.1.3" } }, - "node_modules/react-dom": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", - "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", - "license": "MIT", - "peer": true, - "dependencies": { - "loose-envify": "^1.1.0", - "scheduler": "^0.23.2" - }, - "peerDependencies": { - "react": "^18.3.1" - } - }, "node_modules/react-draggable": { "version": "4.4.6", "resolved": "https://registry.npmjs.org/react-draggable/-/react-draggable-4.4.6.tgz", @@ -13815,16 +13768,6 @@ "node": ">=v12.22.7" } }, - "node_modules/scheduler": { - "version": "0.23.2", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", - "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "loose-envify": "^1.1.0" - } - }, "node_modules/semver": { "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", @@ -15155,21 +15098,6 @@ "webidl-conversions": "^4.0.2" } }, - "node_modules/tsup/node_modules/yaml": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", - "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", - "dev": true, - "license": "ISC", - "optional": true, - "peer": true, - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/tsutils": { "version": "3.21.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", @@ -15519,25 +15447,11 @@ "requires-port": "^1.0.0" } }, - "node_modules/use-isomorphic-layout-effect": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.2.0.tgz", - "integrity": "sha512-q6ayo8DWoPZT0VdG4u3D3uxcgONP3Mevx2i2b0434cwWBoL+aelL1DzkXI6w3PhTZzUeR2kaVlZn70iCiseP6w==", - "license": "MIT", - "peer": true, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, "node_modules/use-sync-external-store": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.4.0.tgz", "integrity": "sha512-9WXSPC5fMv61vaupRkCKCxsPxBocVnwakBEkMIHHpkTTg6icbJtg6jzgtLDm4bl3cSHAca52rYWih0k4K3PfHw==", + "dev": true, "license": "MIT", "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" @@ -15978,17 +15892,6 @@ "dev": true, "license": "MIT" }, - "node_modules/xstate": { - "version": "5.19.2", - "resolved": "https://registry.npmjs.org/xstate/-/xstate-5.19.2.tgz", - "integrity": "sha512-B8fL2aP0ogn5aviAXFzI5oZseAMqN00fg/TeDa3ZtatyDcViYLIfuQl4y8qmHCiKZgGEzmnTyNtNQL9oeJE2gw==", - "license": "MIT", - "peer": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/xstate" - } - }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",