Skip to content

Commit 2229b51

Browse files
committed
update workflows
1 parent cb12f1f commit 2229b51

File tree

2 files changed

+85
-3
lines changed

2 files changed

+85
-3
lines changed

.github/workflows/go.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,26 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1515

1616
- name: Set up Go
17-
uses: actions/setup-go@v2
17+
uses: actions/setup-go@v5
1818
with:
19-
go-version: 1.19
19+
go-version: '1.22'
20+
2021
- name: Install dependencies
2122
run: |
2223
go mod download
24+
2325
- name: Run Unit tests
2426
run: |
2527
go test -race -covermode atomic -coverprofile=cortex-tenant.coverprofile ./...
28+
2629
- name: Install goveralls
2730
env:
2831
GO111MODULE: off
2932
run: go get github.com/mattn/goveralls
33+
3034
- name: Send coverage
3135
env:
3236
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up Go
15+
uses: actions/setup-go@v5
16+
with:
17+
go-version: '1.22'
18+
19+
- name: Install dependencies
20+
run: |
21+
go mod download
22+
23+
- name: Run Unit tests
24+
run: |
25+
go test -race -covermode atomic -coverprofile=cortex-tenant.coverprofile ./...
26+
27+
- name: Build
28+
run: |
29+
go build ./...
30+
31+
- name: Strip
32+
run: /usr/bin/strip cortex-tenant
33+
34+
- name: Create DEB package root
35+
run: |
36+
mkdir -p .debpkg/usr/sbin
37+
mkdir -p .debpkg/etc/systemd/system
38+
mkdir -p .debpkg/etc/default
39+
40+
cp cortex-tenant .debpkg/usr/sbin
41+
cp deploy/cortex-tenant.deb.service .debpkg/etc/systemd/system
42+
cp deploy/cortex-tenant.env .debpkg/etc/default/cortex-tenant
43+
44+
- name: Create RPM package root
45+
run: |
46+
mkdir -p .rpmpkg/usr/sbin
47+
mkdir -p .rpmpkg/etc/systemd/system
48+
mkdir -p .rpmpkg/etc/sysconfig
49+
50+
cp cortex-tenant .rpmpkg/usr/sbin
51+
cp deploy/cortex-tenant.rpm.service .rpmpkg/etc/systemd/system
52+
cp deploy/cortex-tenant.env .rpmpkg/etc/sysconfig/cortex-tenant
53+
54+
- uses: jiro4989/build-deb-action@v3
55+
with:
56+
package: cortex-tenant
57+
package_root: .debpkg
58+
maintainer: "Igor Novgorodov <[email protected]>"
59+
version: ${{ github.ref }}
60+
arch: 'amd64'
61+
desc: "Cortex-Tenant Service"
62+
homepage: "https://github.com/blind-oracle/cortex-tenant"
63+
64+
- uses: jiro4989/build-rpm-action@v2
65+
with:
66+
package: cortex-tenant
67+
package_root: .rpmpkg
68+
maintainer: "Igor Novgorodov <[email protected]>"
69+
version: ${{ github.ref }}
70+
arch: 'x86_64'
71+
summary: "Cortex-Tenant Service"
72+
homepage: "https://github.com/blind-oracle/cortex-tenant"
73+
74+
- uses: ncipollo/release-action@v1
75+
with:
76+
makeLatest: true
77+
artifacts: "cortex-tenant,*.deb,*.rpm"
78+
body: "Cortex-Tenant release"

0 commit comments

Comments
 (0)