diff --git a/.github/workflows/auto-fix.yml b/.github/workflows/auto-fix.yml deleted file mode 100644 index a939b50..0000000 --- a/.github/workflows/auto-fix.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: auto fix - -on: - push: - branches: - - main - -jobs: - tidy: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - persist-credentials: false - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.17 - - - name: Setup Git - run: | - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - - - name: Mod Tidy - run: | - go mod tidy - git add . - git diff-index --quiet HEAD || git commit -m "go mod tidy" - - - name: gofmt - run: | - go fmt ./... - git add . - git diff-index --quiet HEAD || git commit -m "gofmt" - - - name: Pull changes - run: git pull -r - - - name: Push changes - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: ${{ github.ref }} diff --git a/.github/workflows/release.yml b/.github/workflows/ci.yml similarity index 57% rename from .github/workflows/release.yml rename to .github/workflows/ci.yml index 1aee824..3cc81f3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: release +name: CI on: push: @@ -9,7 +9,7 @@ permissions: contents: write jobs: - releaser: + ci: runs-on: ubuntu-latest steps: - name: Checkout @@ -22,6 +22,32 @@ jobs: with: go-version: 1.17 + - name: Setup Git + run: | + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + + - name: tidy + run: | + go mod tidy + git add . + git diff-index --quiet HEAD || git commit -m "go mod tidy" + + - name: gofmt + run: | + go fmt ./... + git add . + git diff-index --quiet HEAD || git commit -m "gofmt" + + - name: Pull changes + run: git pull -r + + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} + - name: Semantic Release if: github.event_name != 'pull_request' uses: go-semantic-release/action@v1 diff --git a/main.go b/main.go index b68812f..2394f6b 100644 --- a/main.go +++ b/main.go @@ -60,5 +60,6 @@ func main() { config.StartTime = time.Now() + wg.Wait() }