Skip to content
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
55 changes: 24 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,33 @@
name: Build and Test

# This workflow will run on master branch and on any pull requests targeting master
on:
push:
branches:
- master
paths-ignore:
- 'docs/**'
- 'src_docs/**'
- '.github/**'
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
#lint:
# name: Lint
# runs-on: ubuntu-latest
# steps:
# - name: Set up Go
# uses: actions/setup-go@v2
# with:
# go-version: 1.18
#
# - name: Check out code
# uses: actions/checkout@v2
#
# - name: Lint Go Code
# run: |
# go get -u golang.org/x/lint/golint
# make lint

test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v6
uses: actions/setup-go@v5
with:
go-version: '1.25'
cache-dependency-path: go.sum

- name: Check out code
uses: actions/checkout@v6
- name: Cache Go build cache
uses: actions/cache@v4
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ hashFiles('**/*.go', 'go.sum') }}
restore-keys: |
${{ runner.os }}-go-build-

- name: Run Unit tests.
run: make test-coverage
Expand All @@ -60,13 +44,22 @@ jobs:
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v6
uses: actions/setup-go@v5
with:
go-version: '1.25'
cache-dependency-path: go.sum

- name: Check out code
uses: actions/checkout@v6
- name: Cache Go build cache
uses: actions/cache@v4
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ hashFiles('**/*.go', 'go.sum') }}
restore-keys: |
${{ runner.os }}-go-build-

- name: Build
run: make build
29 changes: 24 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,30 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Push to Docker Hub
uses: docker/build-push-action@v1
uses: actions/checkout@v4

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: matrix86/driplane
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: matrix86/driplane
tag_with_ref: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
8 changes: 4 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.75.1'
hugo-version: 'latest'
extended: true

- name: Build
run: hugo --minify -s src_docs

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.PERSONAL_TOKEN }}
commit_message: ${{ github.event.head_commit.message }}
Expand Down
34 changes: 12 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ on:
tags:
- 'v*'

permissions:
contents: write

jobs:
release:
name: Release on GitHub
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -19,7 +22,7 @@ jobs:

- name: Find Last Tag
id: last
uses: jimschubert/query-tag-action@v1
uses: jimschubert/query-tag-action@v2
with:
include: 'v*'
exclude: '*-rc*'
Expand All @@ -28,7 +31,7 @@ jobs:

- name: Find Current Tag
id: current
uses: jimschubert/query-tag-action@v1
uses: jimschubert/query-tag-action@v2
with:
include: 'v*'
exclude: '*-rc*'
Expand All @@ -37,37 +40,24 @@ jobs:

- name: Create Changelog
id: changelog
uses: jimschubert/beast-changelog-action@v1
with:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
CONFIG_LOCATION: .github/changelog.json
FROM: ${{steps.last.outputs.tag}}
TO: ${{steps.current.outputs.tag}}
OUTPUT: .github/CHANGELOG.md
run: |
echo "## Changelog" > .github/CHANGELOG.md
git log --pretty=format:"* %s (%h)" ${{steps.last.outputs.tag}}..${{steps.current.outputs.tag}} >> .github/CHANGELOG.md

- name: View Changelog
run: cat .github/CHANGELOG.md

- name: Validates GO releaser config
uses: goreleaser/goreleaser-action@v3
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: check

- name: Create release on GitHub
uses: goreleaser/goreleaser-action@v3
uses: goreleaser/goreleaser-action@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: release --rm-dist --release-notes .github/CHANGELOG.md
#workdir: ./cmd/driplane

#- name: Create release on GitHub
# uses: docker://goreleaser/goreleaser:latest
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# args: release --rm-dist --release-notes .github/CHANGELOG.md
# workdir: ./cmd/driplane
args: release --clean --release-notes .github/CHANGELOG.md