forked from ceph/ceph-ansible
-
Notifications
You must be signed in to change notification settings - Fork 6
40 lines (40 loc) · 1.54 KB
/
build-packages.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
name: Build Packages
on:
push:
branches:
- master-45d-octopus
tags:
- 'v*.*.*'
jobs:
main:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Package Binaries
run: build-packages ${{github.repository}} ${{github.workspace}}
- name: Set Variables
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "PRERELEASE=$(cat ${{github.workspace}}/manifest.json | jq --raw-output '.prerelease')" >> $GITHUB_ENV
echo "TITLE=$(cat ${{github.workspace}}/manifest.json | jq --raw-output '.title')" >> $GITHUB_ENV
echo "VERSION=$(cat ${{github.workspace}}/manifest.json | jq --raw-output '.version')" >> $GITHUB_ENV
echo "REVISION=$(cat ${{github.workspace}}/manifest.json | jq --raw-output '.buildVersion')" >> $GITHUB_ENV
- name: GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
name: ${{env.TITLE}} ${{env.VERSION}}
prerelease: ${{env.PRERELEASE}}
body_path: ${{github.workspace}}/CHANGELOG.md
files: |
${{github.workspace}}/dist/packages/*/*.deb
${{github.workspace}}/dist/packages/*/*.rpm
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Update Repository
if: startsWith(github.ref, 'refs/tags/')
run: update-repositories ${{github.workspace}}
- name: Publish Repository
if: startsWith(github.ref, 'refs/tags/')
run: publish-repo