Skip to content

Merge pull request #82 from raspbeguy/fix-version #4

Merge pull request #82 from raspbeguy/fix-version

Merge pull request #82 from raspbeguy/fix-version #4

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Install dependencies
run: |
go mod download
- name: Run Unit tests
run: |
go test -race ./...
- name: Build
run: |
go build -ldflags "-X main.Version=${{ github.ref }}" ./...
env:
CGO_ENABLED: 0
- name: Strip
run: /usr/bin/strip cortex-tenant
- name: Create DEB package root
run: |
mkdir -p .debpkg/usr/sbin
mkdir -p .debpkg/etc/systemd/system
mkdir -p .debpkg/etc/default
mkdir -p .debpkg/DEBIAN
cp cortex-tenant .debpkg/usr/sbin
cp deploy/cortex-tenant.deb.service .debpkg/etc/systemd/system/cortex-tenant.service
cp deploy/cortex-tenant.env .debpkg/etc/default/cortex-tenant
cp deploy/after_install.sh .debpkg/DEBIAN/postinst
chmod +x .debpkg/DEBIAN/postinst
- name: Create RPM package root
run: |
mkdir -p .rpmpkg/usr/sbin
mkdir -p .rpmpkg/etc/systemd/system
mkdir -p .rpmpkg/etc/sysconfig
cp cortex-tenant .rpmpkg/usr/sbin
cp deploy/cortex-tenant.rpm.service .rpmpkg/etc/systemd/system/cortex-tenant.service
cp deploy/cortex-tenant.env .rpmpkg/etc/sysconfig/cortex-tenant
- uses: jiro4989/build-deb-action@v3
with:
package: cortex-tenant
package_root: .debpkg
maintainer: "Igor Novgorodov <igor@novg.net>"
version: ${{ github.ref }}
arch: 'amd64'
desc: "Cortex-Tenant Service"
homepage: "https://github.com/blind-oracle/cortex-tenant"
- uses: jiro4989/build-rpm-action@v2
with:
package: cortex-tenant
package_root: .rpmpkg
maintainer: "Igor Novgorodov <igor@novg.net>"
version: ${{ github.ref }}
arch: 'x86_64'
summary: "Cortex-Tenant Service"
homepage: "https://github.com/blind-oracle/cortex-tenant"
- uses: ncipollo/release-action@v1
with:
makeLatest: true
artifacts: "cortex-tenant,*.deb,*.rpm"
body: "Cortex-Tenant release"