Skip to content

NOJ - Debian package release hooks #1

NOJ - Debian package release hooks

NOJ - Debian package release hooks #1

Workflow file for this run

name: Go Release
on:
push:
branches:
- main
tags:
- 'v*.*.*' # Matches v1.0.0, v2.1.3, etc.
- 'latest'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux]
goarch: [amd64]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Build
run: |
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o gohip-${{ matrix.goos }}-${{ matrix.goarch }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: gohip-linux-amd64
asset_path: ./gohip-linux-amd64
asset_content_type: application/octet-stream
- name: Create Debian package
env:
DESTDIR: '/tmp/gohip-deb' # keep path absolute - meson has issues with relative paths on CI
run: |
mkdir -p $DESTDIR
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} RELEASE_VERSION=${{ github.event.release.tag_name }} DESTDIR=$DESTDIR make debian-pkg
- name: Upload Debian release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
${{ env.DEB_PKG_NAME }}
${{ env.DEB_PKG_NAME }}.md5sum