Skip to content

workflows #969

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 53 additions & 59 deletions .github/workflows/multi-platform.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Multi-Platform Build and Release

on:
release:
types: [published]
Expand All @@ -9,112 +10,105 @@ 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:
images: ${{ secrets.IMAGE_NAME }}
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
22 changes: 11 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
path: version/number
retention-days: 14
35 changes: 19 additions & 16 deletions .github/workflows/slack.yml
Original file line number Diff line number Diff line change
@@ -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 }}."}'
1 change: 0 additions & 1 deletion .husky/commit-msg

This file was deleted.

1 change: 0 additions & 1 deletion .husky/pre-commit

This file was deleted.

Loading