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

Commit 968098d

Browse files
authored
CI workflows (#4)
1 parent 812eb4d commit 968098d

File tree

4 files changed

+155
-2
lines changed

4 files changed

+155
-2
lines changed

.github/workflows/build.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
build:
13+
runs-on: ${{ matrix.config.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
config:
18+
- { os: "ubuntu-latest" }
19+
- { os: "macos-latest" }
20+
- { os: "windows-latest" }
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
- name: Build
25+
run: cargo build --all-features
26+
- name: Run tests
27+
run: cargo test --all-features

.github/workflows/release.yaml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
tags:
7+
- "v*"
8+
jobs:
9+
build:
10+
name: build release assets
11+
runs-on: ${{ matrix.config.os }}
12+
env: ${{ matrix.config.env }}
13+
strategy:
14+
matrix:
15+
config:
16+
- { os: "ubuntu-latest", arch: "amd64", extension: "", env: {} }
17+
- { os: "macos-latest", arch: "amd64", extension: "", env: {} }
18+
- { os: "windows-latest", arch: "amd64", extension: ".exe", env: {} }
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: set the release version (tag)
23+
if: startsWith(github.ref, 'refs/tags/v')
24+
shell: bash
25+
run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
26+
27+
- name: set the release version (master)
28+
if: github.ref == 'refs/heads/master'
29+
shell: bash
30+
run: echo "RELEASE_VERSION=canary" >> $GITHUB_ENV
31+
32+
- name: lowercase the runner OS name
33+
shell: bash
34+
run: |
35+
OS=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
36+
echo "RUNNER_OS=$OS" >> $GITHUB_ENV
37+
38+
# hack: install rustfmt to work around darwin toolchain issues
39+
- name: "(macOS) install dev tools"
40+
if: runner.os == 'macOS'
41+
run: |
42+
rustup component add rustfmt --toolchain stable-x86_64-apple-darwin
43+
rustup component add clippy --toolchain stable-x86_64-apple-darwin
44+
rustup update stable
45+
46+
- name: build release
47+
uses: actions-rs/cargo@v1
48+
with:
49+
command: build
50+
args: "--all-features --release"
51+
52+
- name: package release assets
53+
shell: bash
54+
run: |
55+
mkdir _dist
56+
cp README.md LICENSE target/release/hippofactory${{ matrix.config.extension }} _dist/
57+
cd _dist
58+
tar czf hippofactory-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz README.md LICENSE hippofactory${{ matrix.config.extension }}
59+
60+
- uses: actions/upload-artifact@v1
61+
with:
62+
name: hippofactory
63+
path: _dist/hippofactory-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz
64+
# publish:
65+
# name: publish release assets
66+
# runs-on: ubuntu-latest
67+
# needs: build
68+
# steps:
69+
# - name: set the release version (tag)
70+
# if: startsWith(github.ref, 'refs/tags/v')
71+
# shell: bash
72+
# run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
73+
# - name: set the release version (master)
74+
# if: github.ref == 'refs/heads/master'
75+
# shell: bash
76+
# run: echo "RELEASE_VERSION=canary" >> $GITHUB_ENV
77+
# - name: download release assets
78+
# uses: actions/download-artifact@v1
79+
# with:
80+
# name: hippofactory
81+
# - name: generate checksums
82+
# run: |
83+
# cd hippofactory
84+
# sha256sum * > checksums-${{ env.RELEASE_VERSION }}.txt
85+
# - name: upload to azure
86+
# uses: bacongobbler/azure-blob-storage-upload@main
87+
# with:
88+
# source_dir: hippofactory
89+
# container_name: releases
90+
# connection_string: ${{ secrets.AzureStorageConnectionString }}
91+
# sync: false

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Microsoft Corporation. All rights reserved.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# hippofactory
22

33
The `hippofactory` tool processes an application's `HIPPOFACTS` (Hippo
4-
artifacts) file and generates a Bindle `invoice.toml` with parcels for
5-
all the files matched by the spec.
4+
artifacts) file and generates a standalone Bindle that can be uploaded
5+
using `bindle push`.
6+
7+
## Contributing
8+
9+
This project welcomes contributions and suggestions. Most contributions require you to agree to a
10+
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
11+
the rights to use your contribution. For details, visit https://cla.microsoft.com.
12+
13+
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
14+
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
15+
provided by the bot. You will only need to do this once across all repos using our CLA.
16+
17+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
18+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
19+
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

0 commit comments

Comments
 (0)