goGoFetch/.forgejo/workflows/release.yaml
nekohepott fc5e30dda3
ха
2026-06-25 19:00:26 +03:00

56 lines
1.6 KiB
YAML

name: Build and Release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: codeberg-small
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y chafa libglib2.0-dev
- name: Build binary
run: make build
- name: Test binary
run: ./gogofetch -h
- name: Package release artifact
run: |
tar -czvf gogofetch-${{ github.ref_name }}-linux-amd64.tar.gz gogofetch Makefile logos/
- name: Create Release and Upload Asset
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const assetName = `gogofetch-${context.ref.replace('refs/tags/', '')}-linux-amd64.tar.gz`;
const release = await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: context.ref.replace('refs/tags/', ''),
name: `Release ${context.ref.replace('refs/tags/', '')}`,
body: "Automated binary release for Arch Linux AUR"
});
await github.rest.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release.data.id,
name: assetName,
data: fs.readFileSync(`./${assetName}`)
});