Skip to content

feat: Add replace command. #37

feat: Add replace command.

feat: Add replace command. #37

Workflow file for this run

name: gsmlg-cli-release
on:
push:
paths:
- "**"
branches:
- +([0-9])?(.{+([0-9]),x}).x
- main
- next
- next-major
- beta
- alpha
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: Setup golang
uses: actions/setup-go@v3
with:
go-version: '1.22.1'
- name: Configure git for private modules
env:
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: git config --global url."https://gsmlg:${TOKEN}@github.com".insteadOf "https://github.com"
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Create package.json
run: |
cat <<EOF > package.json
{
"name": "gsmlg-cli"
}
EOF
- name: 🏗 Run install semantic-release
run: npm install --save-dev semantic-release @semantic-release/exec
- name: 🚀 Release
id: semantic
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GOPRIVATE: github.com/gsmlg-dev/gsmlg-golang
- name: Stop if NO NEW release
run: |
cat <<EOF
Published: ${{ steps.semantic.outputs.new_release_published }}
New Release Version: ${{ steps.semantic.outputs.new_release_version }}
New Release Major Version: ${{ steps.semantic.outputs.new_release_major_version }}
New Release Minor Version: ${{ steps.semantic.outputs.new_release_minor_version }}
New Release Patch Version: ${{ steps.semantic.outputs.new_release_patch_version }}
New Release Channel: ${{ steps.semantic.outputs.new_release_channel }}
New Release Notes:
${{ steps.semantic.outputs.new_release_notes }}
EOF
test -z "${{ steps.semantic.outputs.new_release_version }}" && exit 1 || exit 0
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/gsmlg-cli_*
tag: v${{ steps.semantic.outputs.new_release_version }}
file_glob: true
overwrite: true