Skip to content

Commit

Permalink
ci: switch to reusable workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed Aug 15, 2024
1 parent 165a82b commit 2e478c3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 26 deletions.
28 changes: 6 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
name: Main
name: Lint & Test
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- its-happening

env:
CGO_ENABLED: 1

jobs:
test:
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
matrix:
os: [ ubuntu-latest , macos-latest, windows-latest ]
go-version: [ '1.21', '1.22' ]
steps:
- name: Configure git
run: git config --global core.autocrlf false # required on Windows
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Test
uses: ./.github/actions/test
- name: Build
env:
CGO_ENABLED: 1
run: go build -o bin/ ./cmd/hostd
uses: SiaFoundation/workflows/.github/workflows/go-test.yml@master
13 changes: 9 additions & 4 deletions .github/workflows/publish_v2.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
name: Publish V2
name: Publish

# Controls when the action will run.
on:
# Triggers the workflow when its-happening branch is pushed
# Triggers the workflow on new SemVer tags
push:
branches:
- its-happening
workflow_dispatch:

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

jobs:
publish:
uses: SiaFoundation/workflows/.github/workflows/go-publish.yml@master
secrets: inherit
with:
build-args: -trimpath -a -ldflags '-s -w -linkmode external -extldflags "-static"'
linux-build-args: -tags=timetzdata -trimpath -a -ldflags '-s -w -linkmode external -extldflags "-static"'
windows-build-args: -tags=timetzdata -trimpath -a -ldflags '-s -w -linkmode external -extldflags "-static"'
macos-build-args: -tags=timetzdata -trimpath -a -ldflags '-s -w'
cgo-enabled: 1
project: hostd

0 comments on commit 2e478c3

Please sign in to comment.