-
Notifications
You must be signed in to change notification settings - Fork 3
65 lines (62 loc) · 1.97 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Build and release
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch of the cernbox/reva repository'
required: true
default: 'cernbox'
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
container: golang:1.20
steps:
- name: Checkout release repository
uses: actions/checkout@v3
with:
path: reva-release
- name: Bump version in spec file
run: |
cd reva-release
go run prepare_release.go -author "cernbox-admins[bot]" -email "cernbox-admins@cern.ch"
echo "version=$(awk '$1 == "Version:" {print $2}' revad.spec)" >> $GITHUB_ENV
- name: Checkout reva repository
uses: actions/checkout@v3
with:
repository: cernbox/reva
path: reva
ref: ${{ inputs.branch }}
- name: Copy necessary files for building the RPM
run: |
cp reva-release/Makefile reva/Makefile.rpm
cp reva-release/revad.spec reva/revad.spec
- name: Create reva RPM
run: |
mkdir release
apt update && apt install -y rpm
cd reva
make -f Makefile.rpm rpm
cp revad-${{ env.version }}-1.x86_64.rpm ../release/revad-${{ env.version }}.rpm
env:
CGO_ENABLED: 1
STATIC: 1
- name: Push version
uses: stefanzweifel/git-auto-commit-action@v4
with:
repository: reva-release
commit_message: "Version ${{ env.version }}"
file_pattern: revad.spec
commit_user_name: CERNBox Admins Bot
commit_user_email: cernbox-admins@cern.ch
tagging_message: v${{ env.version }}
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: false
prerelease: false
files: release/revad-${{ env.version }}.rpm
name: Version ${{ env.version }}
tag_name: v${{ env.version }}