Skip to content

Commit

Permalink
Cleanup and improve GitHub Actions (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnested authored Oct 18, 2022
1 parent 6d9ef70 commit 0ce2430
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 19 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: monthly
- package-ecosystem: gomod
directory: "/"
schedule:
interval: monthly
- package-ecosystem: docker
directory: "/"
schedule:
interval: monthly
3 changes: 3 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
- main
- latest

permissions:
contents: write

jobs:
build:
name: Documentation
Expand Down
27 changes: 22 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,36 @@ on:
paths-ignore:
- 'docs/*'

permissions:
contents: read

jobs:
go-versions:
name: Lookup go versions
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.versions.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- uses: arnested/go-version-action@v1
id: versions
build:
name: Build Shoutrrr
runs-on: ubuntu-latest
needs: go-versions
strategy:
matrix:
version: ${{ fromJSON(needs.go-versions.outputs.matrix) }}
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
- name: Set up Go ${{ matrix.version }}
uses: actions/setup-go@v3
id: go
with:
go-version: 1.13
go-version: ${{ matrix.version }}
check-latest: true

- name: Check out code
uses: actions/checkout@v1
uses: actions/checkout@v3

- name: Build
run: CGO_ENABLED=0 go build -v .
Expand All @@ -32,6 +49,6 @@ jobs:
run: CGO_ENABLED=0 go test -v -coverprofile=coverage.out -covermode=atomic ./...

- name: Publish coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+'
- '**/v[0-9]+.[0-9]+.[0-9]+'

permissions: {}

jobs:
build:
name: Renew documentation
Expand Down
36 changes: 22 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,28 @@ on:
tags:
- v*

permissions:
contents: read

jobs:
build:
name: Build Shoutrrr
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: enabled
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
- name: Check out code
uses: actions/checkout@v3

- uses: arnested/go-version-action@v1
id: go-version

- name: Set up Go ${{ steps.go-version.outputs.latest }}
uses: actions/setup-go@v3
id: go
with:
go-version: 1.13

- name: Check out code
uses: actions/checkout@v1
go-version: ${{ steps.go-version.outputs.latest }}
check-latest: true

- name: Build
run: CGO_ENABLED=0 go build -v .
Expand All @@ -28,16 +35,17 @@ jobs:
run: CGO_ENABLED=0 go test -v -coverprofile=coverage.out -covermode=atomic ./...

- name: Publish coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Install goreleaser
run: |
cd .. && \
wget https://github.com/goreleaser/goreleaser/releases/download/v0.138.0/goreleaser_Linux_x86_64.tar.gz && \
tar -xvf goreleaser_Linux_x86_64.tar.gz && \
./goreleaser -v
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
install-only: true

- name: Show GoReleaser version
run: goreleaser -v

- name: Login to docker hub
uses: azure/docker-login@v1
Expand All @@ -47,7 +55,7 @@ jobs:

- name: Execute goreleaser
run: |
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} CGO_ENABLED=0 ../goreleaser --debug --rm-dist
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} CGO_ENABLED=0 goreleaser --debug --rm-dist
- name: Enable experimental docker features
run: |
Expand Down

0 comments on commit 0ce2430

Please sign in to comment.