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

fix: workflow change #49

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
68 changes: 53 additions & 15 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,56 @@ name: Default
on:
push:
branches:
- '*'
- main
pull_request:
branches:
- main

jobs:

precommit:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.semrel.outputs.version }}

steps:

- name: Checkout
uses: actions/checkout@v4

- name: remove golangci from precommit-configuration
run: |
sed -i 's/.*id: golangci-lint//' .pre-commit-config.yaml
sed -i '/^\s*$/d' .pre-commit-config.yaml

- uses: pre-commit/[email protected]
continue-on-error: true

- uses: go-semantic-release/action@v1
id: semrel
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
dry: true

- name: Lint
uses: golangci/golangci-lint-action@v6
with:
version: latest


build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.20.x]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ^1.18
go-version: ${{ matrix.go-version }}
id: go

- name: Cache Go modules
Expand All @@ -32,21 +67,24 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: remove golangci from precommit-configuration
run: |
sed -i 's/.*id: golangci-lint//' .pre-commit-config.yaml
sed -i '/^\s*$/d' .pre-commit-config.yaml

- uses: pre-commit/[email protected]
continue-on-error: true

- name: Build
run: make all
run: |
mkdir -p /tmp
make all

- name: Lint
uses: golangci/golangci-lint-action@v6
- uses: actions/upload-artifact@v4
with:
version: latest
name: wattpilot_tools
path: |
shell/shell
prometheus/wattpilot_exporter
release:
name: Release
needs: [ precommit, build ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: go-semantic-release/action@v1
id: semrel
Expand Down
Loading