File: release.yml

package info (click to toggle)
golang-github-samber-slog-common 0.0~git20250908.8eb9dfc-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 152 kB
  • sloc: makefile: 34
file content (56 lines) | stat: -rw-r--r-- 1,361 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Release

on:
  workflow_dispatch:
    inputs:
      semver:
        type: string
        description: 'Semver (eg: v1.2.3)'
        required: true

jobs:
  release:
    if: github.triggering_actor == 'samber'
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v5

    - name: Set up Go
      uses: actions/setup-go@v6
      with:
        go-version: 1.21
        stable: false

    - name: Test
      run: make test

    # remove tests in order to clean dependencies
    - name: Remove xxx_test.go files
      run: rm -rf *_test.go ./examples ./images

    # cleanup test dependencies
    - name: Cleanup dependencies
      run: go mod tidy

    - name: List files
      run: tree -Cfi
    - name: Write new go.mod into logs
      run: cat go.mod
    - name: Write new go.sum into logs
      run: cat go.sum

    - name: Create tag
      run: |
          git config --global user.name '${{ github.triggering_actor }}'
          git config --global user.email "${{ github.triggering_actor}}@users.noreply.github.com"

          git add .
          git commit --allow-empty -m 'bump ${{ inputs.semver }}'
          git tag ${{ inputs.semver }}
          git push origin ${{ inputs.semver }}

    - name: Release
      uses: softprops/action-gh-release@v2
      with:
        name: ${{ inputs.semver }}
        tag_name: ${{ inputs.semver }}