Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
CI workflows (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
itowlson authored May 5, 2021
1 parent 812eb4d commit 968098d
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 2 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build

on:
push:
branches: [master]
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- { os: "ubuntu-latest" }
- { os: "macos-latest" }
- { os: "windows-latest" }

steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --all-features
- name: Run tests
run: cargo test --all-features
91 changes: 91 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Release
on:
push:
branches:
- master
tags:
- "v*"
jobs:
build:
name: build release assets
runs-on: ${{ matrix.config.os }}
env: ${{ matrix.config.env }}
strategy:
matrix:
config:
- { os: "ubuntu-latest", arch: "amd64", extension: "", env: {} }
- { os: "macos-latest", arch: "amd64", extension: "", env: {} }
- { os: "windows-latest", arch: "amd64", extension: ".exe", env: {} }
steps:
- uses: actions/checkout@v2

- name: set the release version (tag)
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV

- name: set the release version (master)
if: github.ref == 'refs/heads/master'
shell: bash
run: echo "RELEASE_VERSION=canary" >> $GITHUB_ENV

- name: lowercase the runner OS name
shell: bash
run: |
OS=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
echo "RUNNER_OS=$OS" >> $GITHUB_ENV
# hack: install rustfmt to work around darwin toolchain issues
- name: "(macOS) install dev tools"
if: runner.os == 'macOS'
run: |
rustup component add rustfmt --toolchain stable-x86_64-apple-darwin
rustup component add clippy --toolchain stable-x86_64-apple-darwin
rustup update stable
- name: build release
uses: actions-rs/cargo@v1
with:
command: build
args: "--all-features --release"

- name: package release assets
shell: bash
run: |
mkdir _dist
cp README.md LICENSE target/release/hippofactory${{ matrix.config.extension }} _dist/
cd _dist
tar czf hippofactory-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz README.md LICENSE hippofactory${{ matrix.config.extension }}
- uses: actions/upload-artifact@v1
with:
name: hippofactory
path: _dist/hippofactory-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz
# publish:
# name: publish release assets
# runs-on: ubuntu-latest
# needs: build
# steps:
# - name: set the release version (tag)
# if: startsWith(github.ref, 'refs/tags/v')
# shell: bash
# run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
# - name: set the release version (master)
# if: github.ref == 'refs/heads/master'
# shell: bash
# run: echo "RELEASE_VERSION=canary" >> $GITHUB_ENV
# - name: download release assets
# uses: actions/download-artifact@v1
# with:
# name: hippofactory
# - name: generate checksums
# run: |
# cd hippofactory
# sha256sum * > checksums-${{ env.RELEASE_VERSION }}.txt
# - name: upload to azure
# uses: bacongobbler/azure-blob-storage-upload@main
# with:
# source_dir: hippofactory
# container_name: releases
# connection_string: ${{ secrets.AzureStorageConnectionString }}
# sync: false
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Microsoft Corporation. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# hippofactory

The `hippofactory` tool processes an application's `HIPPOFACTS` (Hippo
artifacts) file and generates a Bindle `invoice.toml` with parcels for
all the files matched by the spec.
artifacts) file and generates a standalone Bindle that can be uploaded
using `bindle push`.

## Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

0 comments on commit 968098d

Please sign in to comment.