From ea7fb2774f98d7911ca0dbe7ed34b634ebaf6d6b Mon Sep 17 00:00:00 2001 From: Medzik <8584366-Medzik@users.noreply.gitlab.com> Date: Fri, 30 Jul 2021 21:01:25 +0000 Subject: [PATCH] Update Workflow, gitpod Dockerfile, nodemon.sh --- .github/dependabot.yml | 14 -------------- .github/workflows/lint.yml | 2 +- .github/workflows/pull.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/release.yml | 12 +++++++++--- .gitpod.Dockerfile | 6 +++--- nodemon.sh | 10 +++++----- 6 files changed, 48 insertions(+), 26 deletions(-) delete mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/pull.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ea1c34f..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: 2 - -updates: - # Maintain dependencies for Go modules - - package-ecosystem: "gomod" - directory: "/" - schedule: - interval: "daily" - - # Maintain dependencies for GitHub Actions - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 042d51a..c6aaa85 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: lint +name: Lint on: pull_request: diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml new file mode 100644 index 0000000..d2141aa --- /dev/null +++ b/.github/workflows/pull.yml @@ -0,0 +1,30 @@ +name: Pull Request + +on: + pull_request: + +jobs: + pull: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + distribution: goreleaser + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + path: dist diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aa441f2..252cd43 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,22 +1,28 @@ -name: goreleaser +name: Release on: - pull_request: push: + branches: [ main ] permissions: contents: write jobs: - goreleaser: + releaser: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 + - name: Set up Go uses: actions/setup-go@v2 with: go-version: 1.16 + + - uses: go-semantic-release/action@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 98e891c..65c22ab 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,9 +1,9 @@ FROM gitpod/workspace-full -RUN brew install goreleaser +# GoReleaser +RUN curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh +# GoLangCI Lint RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.41.1 -RUN golangci-lint --version - RUN npm i -g nodemon diff --git a/nodemon.sh b/nodemon.sh index f585cf5..29bd2d6 100644 --- a/nodemon.sh +++ b/nodemon.sh @@ -9,9 +9,9 @@ if ! go build -o pingbot.out; then exit 1 else if ! ./pingbot.out; then - echo -e "${reset}[${red}PROGRAM PANIC${reset}]" - exit 1 - else - echo -e "${reset}[${red}PROGRAM END${reset}]" - fi + echo -e "${reset}[${red}PROGRAM PANIC${reset}]" + exit 1 + else + echo -e "${reset}[${red}PROGRAM END${reset}]" + fi fi