| name: CI |
| |
| on: |
| push: |
| branches: [ master ] |
| pull_request: |
| branches: [ master ] |
| |
| jobs: |
| test: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v4 |
| with: |
| fetch-depth: 0 |
| |
| - name: Set up Go |
| uses: actions/setup-go@v4 |
| with: |
| go-version: '1.21' |
| |
| - name: Test |
| run: go test -v ./... |
| |
| release: |
| needs: test |
| runs-on: ubuntu-latest |
| if: github.event_name == 'push' && github.ref == 'refs/heads/master' |
| steps: |
| - uses: actions/checkout@v4 |
| with: |
| fetch-depth: 0 |
| |
| - name: Setup Node.js |
| uses: actions/setup-node@v4 |
| with: |
| node-version: '18' |
| |
| - name: Install semantic-release |
| run: npm install -g semantic-release @semantic-release/github |
| |
| - name: Release |
| env: |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| run: npx semantic-release |