add workflow
This commit is contained in:
parent
11c3a3d536
commit
e56520ce11
53
.forgejo/workflows/release.yaml
Normal file
53
.forgejo/workflows/release.yaml
Normal file
@ -0,0 +1,53 @@
|
||||
name: Build and Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
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 --version
|
||||
|
||||
- name: Package release artifact
|
||||
run: |
|
||||
tar -czvf gogofetch-${{ github.ref_name }}-linux-amd64.tar.gz gogofetch Makefile logos/
|
||||
|
||||
- name: Create Release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: Release ${{ github.ref_name }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
- name: Upload Release Asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./gogofetch-${{ github.ref_name }}-linux-amd64.tar.gz
|
||||
asset_name: gogofetch-${{ github.ref_name }}-linux-amd64.tar.gz
|
||||
asset_content_type: application/gzip
|
||||
Loading…
Reference in New Issue
Block a user