Skip to content

fix(release): skip publish when release assets already exist #85

fix(release): skip publish when release assets already exist

fix(release): skip publish when release assets already exist #85

Workflow file for this run

name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
permissions:
contents: read
jobs:
dependabot-actions-check:
name: Dependabot Actions Check
if: github.actor == 'dependabot[bot]' && startsWith(github.head_ref, 'dependabot/github_actions/')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Validate workflow syntax
run: |
ruby -e 'Dir[".github/workflows/*.{yml,yaml}"].each { |f| require "yaml"; YAML.load_file(f); puts "validated #{f}" }'
test:
name: Test
if: github.actor != 'dependabot[bot]' || !startsWith(github.head_ref, 'dependabot/github_actions/')
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Checkout cimis-tsdb
uses: actions/checkout@v7
with:
repository: dl-alexandre/cimis-tsdb
token: ${{ secrets.GH_PAT }}
path: _deps/cimis-tsdb
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Configure git for private repos
run: |
git config --global url."https://x-access-token:${{ secrets.GH_PAT }}@github.com/".insteadOf "https://github.com/"
- name: Download dependencies
run: go mod download
- name: Verify dependencies
run: go mod verify
- name: Build C library
shell: bash
run: |
if command -v gcc >/dev/null 2>&1; then
cd c && gcc -c -O2 -fPIC cimis_storage.c -o cimis_storage.o && ar rcs libcimis_storage.a cimis_storage.o
else
echo "No C compiler available, will use build-pure"
fi
- name: Run go vet
shell: bash
run: |
if [ -f c/libcimis_storage.a ]; then
make vet
else
CGO_ENABLED=0 go vet ./...
fi
- name: Run tests with flaky diagnostics (non-Windows)
if: matrix.os != 'windows-latest'
run: |
set -o pipefail
mkdir -p .artifacts/coverage
mkdir -p .artifacts/test
attempt=1
while [ $attempt -le 2 ]; do
echo "Test attempt ${attempt}"
if CGO_ENABLED=1 go test -json -v -race -coverprofile=.artifacts/coverage/coverage.out -covermode=atomic ./... | tee .artifacts/test/test-attempt-${attempt}.json; then
exit 0
fi
attempt=$((attempt + 1))
done
exit 1
- name: Run tests (Windows)
if: matrix.os == 'windows-latest'
run: go test -v ./...
- name: Upload test diagnostics
if: failure() && matrix.os != 'windows-latest'
uses: actions/upload-artifact@v7
with:
name: cimis-test-diagnostics-${{ matrix.os }}
path: .artifacts/test/
retention-days: 7
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7
if: matrix.os == 'ubuntu-latest'
with:
files: ./.artifacts/coverage/coverage.out
flags: unittests
fail_ci_if_error: false
build:
name: Build
if: github.actor != 'dependabot[bot]' || !startsWith(github.head_ref, 'dependabot/github_actions/')
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Checkout cimis-tsdb
uses: actions/checkout@v7
with:
repository: dl-alexandre/cimis-tsdb
token: ${{ secrets.GH_PAT }}
path: _deps/cimis-tsdb
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Configure git for private repos
run: |
git config --global url."https://x-access-token:${{ secrets.GH_PAT }}@github.com/".insteadOf "https://github.com/"
- name: Download dependencies
run: go mod download
- name: Build CGO binary
run: make build
- name: Build pure Go path
run: make build-pure
- name: Verify version metadata
run: |
make build-pure
./build/cimis version | grep -F "cimis"
- name: Generate checksums
run: make checksums
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: binaries
path: |
build/
build/checksums.txt
retention-days: 7
lint:
name: Lint
if: github.actor != 'dependabot[bot]' || !startsWith(github.head_ref, 'dependabot/github_actions/')
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Checkout cimis-tsdb
uses: actions/checkout@v7
with:
repository: dl-alexandre/cimis-tsdb
token: ${{ secrets.GH_PAT }}
path: _deps/cimis-tsdb
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Configure git for private repos
run: |
git config --global url."https://x-access-token:${{ secrets.GH_PAT }}@github.com/".insteadOf "https://github.com/"
- name: Run golangci-lint
continue-on-error: true
uses: golangci/golangci-lint-action@v9.3.0
with:
version: v2.12.2
skip-cache: true
args: --timeout=5m
security:
name: Security Scan
if: github.actor != 'dependabot[bot]' || !startsWith(github.head_ref, 'dependabot/github_actions/')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Checkout cimis-tsdb
uses: actions/checkout@v7
with:
repository: dl-alexandre/cimis-tsdb
token: ${{ secrets.GH_PAT }}
path: _deps/cimis-tsdb
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Configure git for private repos
run: |
git config --global url."https://x-access-token:${{ secrets.GH_PAT }}@github.com/".insteadOf "https://github.com/"
- name: Run security scan
run: make security