fix: Update go to 1.22, change config file to xdg_data_dir. #27
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: 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@v2 | |
- name: Setup golang | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.18.2' | |
- 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: 🚀 Release | |
uses: cycjimmy/semantic-release-action@v3 | |
id: semantic # Need an `id` for output variables | |
with: | |
extra_plugins: | | |
@semantic-release/exec | |
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 |