-
Notifications
You must be signed in to change notification settings - Fork 11
Add release workflow for litani #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
on: | ||
push: | ||
tags: | ||
- 'litani-*' | ||
|
||
name: Create Release | ||
|
||
jobs: | ||
perform-release: | ||
name: Perform Release | ||
runs-on: ubuntu-20.04 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_CI_ACCESS_TOKEN }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Get Version | ||
run: echo "VERSION=$(echo ${{ github.ref }} | cut -d "/" -f 3 | cut -d "-" -f 2)" >> $GITHUB_ENV | ||
- name: Create release | ||
uses: actions/create-release@v1 | ||
with: | ||
tag_name: litani-${{ env.VERSION }} | ||
release_name: litani-${{ env.VERSION }} | ||
body: | | ||
This is Litani version ${{ env.VERSION }}. | ||
|
||
## MacOS | ||
|
||
On MacOS, install Litani using [Homebrew](https://brew.sh/) with | ||
|
||
```sh | ||
brew install aws/tap/litani | ||
``` | ||
|
||
or upgrade (if it's already been installed) with: | ||
|
||
```sh | ||
brew upgrade litani | ||
``` | ||
|
||
## Ubuntu | ||
|
||
On Ubuntu, install Litani by downloading the *.deb package below for Ubuntu 20 and install with | ||
|
||
```sh | ||
# Ubuntu 20.04: | ||
$ apt install -y ./litani-${{ env.VERSION }}.deb | ||
``` | ||
draft: false | ||
prerelease: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
on: | ||
release: | ||
types: [created] | ||
|
||
name: Upload additional release assets | ||
jobs: | ||
ubuntu-20_04-package: | ||
name: Generate ubuntu-20.04 debian package | ||
runs-on: ubuntu-20.04 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get Version | ||
run: echo "VERSION=$(echo ${{ github.ref }} | cut -d "/" -f 3 | cut -d "-" -f 2)" >> $GITHUB_ENV | ||
- name: Setup directory for deb package | ||
run: | | ||
sudo apt-get install -y mandoc scdoc ninja-build | ||
mkdir -p litani-${{ env.VERSION }}/{DEBIAN,usr/{bin,libexec/litani,share/{doc/litani,man/{man1,man5,man7}}}} | ||
touch litani-${{ env.VERSION }}/DEBIAN/control | ||
cat << EOF > litani-${{ env.VERSION }}/DEBIAN/control | ||
Package: Litani | ||
Version: ${{ env.VERSION }} | ||
Architecture: amd64 | ||
Depends: ninja-build, gnuplot, graphviz, python3-jinja2 | ||
Maintainer: Kareem Khazem <[email protected]> | ||
Description: A program that provides platform-independent job control. | ||
AWS Build Accumulator collects build jobs from multiple sources before executing | ||
them concurrently. It provides platform-independent job control (timeouts, | ||
return code control) and an output format that is easy to render into reports | ||
(for example, using the built-in renderer). AWS Build Accumulator shines where | ||
your project uses multiple different build systems or requires a unified | ||
interface describing heterogeneous build jobs. | ||
EOF | ||
./doc/configure && ninja | ||
mv bin lib templates litani litani-${{ env.VERSION }}/usr/libexec/litani/ | ||
mv doc/out/man/*.1 litani-${{ env.VERSION }}/usr/share/man/man1 | ||
mv doc/out/man/*.5 litani-${{ env.VERSION }}/usr/share/man/man5 | ||
mv doc/out/man/*.7 litani-${{ env.VERSION }}/usr/share/man/man7 | ||
mv doc/out/html/index.html litani-${{ env.VERSION }}/usr/share/doc/litani | ||
ln -s /usr/libexec/litani/litani litani-${{ env.VERSION }}/usr/bin/ | ||
rm -r $(ls -A | grep -v litani-${{ env.VERSION }}) | ||
- name: Create .deb package | ||
id: create_packages | ||
run: | | ||
sudo dpkg-deb --build --root-owner-group litani-${{ env.VERSION }} | ||
deb_package_name="$(ls *.deb)" | ||
echo "::set-output name=deb_package::$deb_package_name" | ||
echo "::set-output name=deb_package_name::$deb_package_name" | ||
- name: Install Litani using deb package | ||
run: sudo apt-get update && sudo apt install -y ./litani-${{ env.VERSION }}.deb | ||
- name: Test deb package | ||
run: | | ||
litani -h | ||
man litani | ||
litani init --project-name test | ||
litani add-job --command '/usr/bin/true' --pipeline-name 'test' --ci-stage test | ||
litani run-build | ||
- name: Get release | ||
id: get_release_info | ||
uses: bruceadams/[email protected] | ||
- name: Upload release binary | ||
uses: actions/[email protected] | ||
with: | ||
upload_url: ${{ steps.get_release_info.outputs.upload_url }} | ||
asset_path: ${{ steps.create_packages.outputs.deb_package }} | ||
asset_name: ${{ steps.create_packages.outputs.deb_package_name }} | ||
asset_content_type: application/x-deb | ||
|
||
homebrew-pr: | ||
name: Homebrew Bump Formula PR | ||
runs-on: macos-10.15 | ||
steps: | ||
- name: Get release tag name | ||
run: echo "RELEASE_TAG=${GITHUB_REF/refs\/tags\/}" >> $GITHUB_ENV | ||
- name: Configure git user name and email | ||
uses: Homebrew/actions/git-user-config@master | ||
with: | ||
username: aws-build-accumulator-release-ci | ||
- name: Create homebrew PR | ||
run: | | ||
brew update-reset | ||
brew tap aws/tap | ||
brew bump-formula-pr --tag "$RELEASE_TAG" --revision "$GITHUB_SHA" aws/tap/litani | ||
env: | ||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.RELEASE_CI_ACCESS_TOKEN }} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.