Skip to content

Improve README.md file #367

Improve README.md file

Improve README.md file #367

Workflow file for this run

name: Go
on:
push:
branches: [ "main", "dev" ]
paths-ignore:
- 'README.md'
pull_request:
branches: [ "main", "dev" ]
types: [opened, synchronize, reopened, ready_for_review]
permissions:
contents: write
jobs:
build:
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && !github.event.pull_request.draft)
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.19', '1.20', '1.21']
os: [ 'linux', 'windows', 'darwin' ]
arch: [ 'amd64', 'arm64' ]
outputs:
commit-hash: ${{ steps.get_commit.outputs.commit }}
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Build
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
run: go build -v ./...
update-version:
needs: build
if: github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: 'dev'
- name: Update Version in config.go
run: |
sed -i "s/const Version = \".*\"/const Version = \"$GITHUB_SHA\"/" config/config.go
- name: Commit and Push
run: |
git config --global user.email "[email protected]"
git config --global user.name "Github Action"
git add config/config.go
git commit -m "Update dev version to $GITHUB_SHA"
git push origin HEAD:dev