Skip to content

Commit d2bd96b

Browse files
committed
Add deb package and homebrew PR release workflows
1 parent f5f807f commit d2bd96b

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
on:
2+
release:
3+
types: [created]
4+
5+
name: Upload additional release assets
6+
jobs:
7+
ubuntu-20_04-package:
8+
name: Generate ubuntu-20.04 debian package
9+
runs-on: ubuntu-20.04
10+
env:
11+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Get Version
15+
run: echo "VERSION=$(echo ${{ github.ref }} | cut -d "/" -f 3 | cut -d "-" -f 2)" >> $GITHUB_ENV
16+
- name: Setup directory for deb package
17+
run: |
18+
sudo apt-get install -y mandoc scdoc ninja-build
19+
mkdir -p litani-${{ env.VERSION }}/{DEBIAN,usr/{bin,libexec/litani,share/{doc/litani,man/{man1,man5,man7}}}}
20+
touch litani-${{ env.VERSION }}/DEBIAN/control
21+
cat << EOF > litani-${{ env.VERSION }}/DEBIAN/control
22+
Package: Litani
23+
Version: ${{ env.VERSION }}
24+
Architecture: amd64
25+
Depends: ninja-build, gnuplot, graphviz, python3-jinja2
26+
Maintainer: Kareem Khazem <[email protected]>
27+
Description: A program that provides platform-independent job control.
28+
AWS Build Accumulator collects build jobs from multiple sources before executing
29+
them concurrently. It provides platform-independent job control (timeouts,
30+
return code control) and an output format that is easy to render into reports
31+
(for example, using the built-in renderer). AWS Build Accumulator shines where
32+
your project uses multiple different build systems or requires a unified
33+
interface describing heterogeneous build jobs.
34+
EOF
35+
./doc/configure && ninja
36+
mv bin lib templates litani litani-${{ env.VERSION }}/usr/libexec/litani/
37+
mv doc/out/man/*.1 litani-${{ env.VERSION }}/usr/share/man/man1
38+
mv doc/out/man/*.5 litani-${{ env.VERSION }}/usr/share/man/man5
39+
mv doc/out/man/*.7 litani-${{ env.VERSION }}/usr/share/man/man7
40+
mv doc/out/html/index.html litani-${{ env.VERSION }}/usr/share/doc/litani
41+
ln -s /usr/libexec/litani/litani litani-${{ env.VERSION }}/usr/bin/
42+
rm -r $(ls -A | grep -v litani-${{ env.VERSION }})
43+
- name: Create .deb package
44+
id: create_packages
45+
run: |
46+
sudo dpkg-deb --build --root-owner-group litani-${{ env.VERSION }}
47+
deb_package_name="$(ls *.deb)"
48+
echo "::set-output name=deb_package::$deb_package_name"
49+
echo "::set-output name=deb_package_name::$deb_package_name"
50+
- name: Install Litani using deb package
51+
run: sudo apt install -y ./litani-${{ env.VERSION }}.deb
52+
- name: Test deb package
53+
run: |
54+
litani -h
55+
man litani
56+
litani init --project-name test
57+
litani add-job --command '/usr/bin/true' --pipeline-name 'test' --ci-stage test
58+
litani run-build
59+
- name: Get release
60+
id: get_release_info
61+
uses: bruceadams/[email protected]
62+
- name: Upload release binary
63+
uses: actions/[email protected]
64+
with:
65+
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
66+
asset_path: ${{ steps.create_packages.outputs.deb_package }}
67+
asset_name: ${{ steps.create_packages.outputs.deb_package_name }}
68+
asset_content_type: application/x-deb
69+
70+
homebrew-pr:
71+
name: Homebrew Bump Formula PR
72+
runs-on: macos-10.15
73+
steps:
74+
- name: Get release tag name
75+
run: echo "RELEASE_TAG=${GITHUB_REF/refs\/tags\/}" >> $GITHUB_ENV
76+
- name: Configure git user name and email
77+
uses: Homebrew/actions/git-user-config@master
78+
with:
79+
username: aws-build-accumulator-release-ci
80+
- name: Create homebrew PR
81+
run: |
82+
brew update-reset
83+
brew tap ronakfof/litani
84+
brew bump-formula-pr --tag "$RELEASE_TAG" --revision "$GITHUB_SHA" ronakfof/litani/litani
85+
env:
86+
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.RELEASE_CI_ACCESS_TOKEN }}

0 commit comments

Comments
 (0)