mirror of
https://github.com/Lifailon/lazyjournal.git
synced 2026-11-11 01:09:46 +01:00
60 lines
1.5 KiB
YAML
60 lines
1.5 KiB
YAML
name: "[CI] Build rpm packages and push to Fedora Copr"
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
Upload:
|
|
description: 'Upload rpm packages to artifacts'
|
|
default: true
|
|
type: boolean
|
|
Push:
|
|
description: 'Publish to Copr'
|
|
default: false
|
|
type: boolean
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
copr:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository (all commits)
|
|
uses: actions/checkout@v7
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install Go
|
|
uses: actions/setup-go@v7
|
|
with:
|
|
go-version: 1.27.0
|
|
|
|
- name: Add rpm format to goreleaser config
|
|
run: echo -e "\n - rpm" >> .goreleaser.yaml
|
|
|
|
- name: Build packages using goreleaser
|
|
uses: goreleaser/goreleaser-action@v7
|
|
with:
|
|
distribution: goreleaser
|
|
args: release --clean --skip=publish --skip=validate
|
|
|
|
- name: Upload rpm package
|
|
if: ${{ github.event.inputs.Upload == 'true' }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: rpm-packages
|
|
path: dist/*.rpm
|
|
|
|
- name: Install copr cli
|
|
if: ${{ github.event.inputs.Push == 'true' }}
|
|
run: pip install copr-cli
|
|
|
|
- name: Publish to Copr
|
|
if: ${{ github.event.inputs.Push == 'true' }}
|
|
env:
|
|
COPR_CONFIG: ${{ secrets.COPR_CONFIG }}
|
|
run: |
|
|
mkdir -p ~/.config
|
|
echo "$COPR_CONFIG" > ~/.config/copr
|
|
copr-cli build lazyjournal dist/*.rpm |