Skip to content

Update GitHub actions #194

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

Merged
merged 3 commits into from
Jan 19, 2024
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
5 changes: 5 additions & 0 deletions .github/workflows/build-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
pull_request:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

env:
REGISTRY: ghcr.io
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/buildTestBinaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
branches:
- main
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -23,9 +28,10 @@ jobs:
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: "^1.20" # The Go version to download (if necessary) and use.
check-latest: true

- name: Set version and ui_file
id: vars
Expand All @@ -45,7 +51,7 @@ jobs:
UI_FILE: ${{ steps.vars.outputs.ui_file }}

- name: Upload assets
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: client_application-${{ steps.vars.outputs.version }}
path: |
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/checkFormat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
pull_request:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

jobs:
format:
Expand All @@ -15,9 +20,10 @@ jobs:
with:
# fetch branches and history so `git merge-base` in check-format-on-diff works correctly
fetch-depth: 0
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: "^1.20" # The Go version to download (if necessary) and use.
check-latest: true

- name: Check formatting
shell: bash
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,22 @@ on:
pull_request:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: "^1.20" # The Go version to download (if necessary) and use.
check-latest: true
- run: go version
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
Expand Down
43 changes: 33 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@ name: goreleaser

on:
push:
# run only against tags
branches:
- main
tags:
- '*'
# Create a release on a tag push
- "*"
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

permissions:
contents: write
Expand All @@ -24,24 +32,39 @@ jobs:
-
name: Fetch all tags
run: git fetch --force --tags
-
name: Set up Go
uses: actions/setup-go@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.20
go-version: "1.20"

- name: Print Go version
run: go version

- name: Print supported platforms
run: go tool dist list

- name: Set ui_file
id: vars
run: |
echo "ui_file=$(pwd)/.tmp/ui.tar.gz" >> $GITHUB_OUTPUT
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4

- name: Set args for goreleaser
id: args
run: |
if ${{ github.ref_type == 'tag' }} ; then
echo "args=release --rm-dist" >> $GITHUB_OUTPUT
else
echo "args=release --rm-dist --skip-validate --skip-publish" >> $GITHUB_OUTPUT
fi

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --rm-dist
args: ${{ steps.args.outputs.args }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UI_SEPARATOR: "--------UI--------"
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/staticAnalysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@ on:
pull_request:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

jobs:
analysis:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: "^1.20" # The Go version to download (if necessary) and use.
check-latest: true
- run: go version

- name: Run go vet
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
tags:
- "*"
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -23,9 +28,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: "^1.20" # The Go version to download (if necessary) and use.
check-latest: true

- name: Run a test
run: make test
Expand Down