Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup and improve GitHub Actions #273

Merged
merged 7 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/containrrr/shoutrrr

go 1.12
go 1.13

require (
github.com/fatih/color v1.10.0
Expand Down