-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from snowplow/release/0.3.0
Release/0.3.0
- Loading branch information
Showing
24 changed files
with
278 additions
and
111 deletions.
There are no files selected for viewing
This file contains 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,125 @@ | ||
name: cd | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
ubuntu: | ||
name: Compile Linux | ||
strategy: | ||
matrix: | ||
os: [ubuntu-18.04] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Install latest rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
default: true | ||
override: true | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Test | ||
run: make test | ||
|
||
- name: Extract tag version from ref | ||
id: get_version | ||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | ||
|
||
- name: Build | ||
run: make zip | ||
env: | ||
PLATFORM: linux | ||
BUILD_VERSION: ${{ steps.get_version.outputs.VERSION }} | ||
|
||
- name: Upload binary | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: factotum_server_${{ steps.get_version.outputs.VERSION }}_linux_x86_64.zip | ||
path: build/compiled/factotum_server_${{ steps.get_version.outputs.VERSION }}_linux_x86_64.zip | ||
|
||
macos: | ||
name: Compile macOS | ||
strategy: | ||
matrix: | ||
os: [macos-10.15] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Install latest rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: x86_64-apple-darwin | ||
default: true | ||
override: true | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Test | ||
run: make test | ||
|
||
- name: Extract tag version from ref | ||
id: get_version | ||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | ||
|
||
- name: Build | ||
run: make zip | ||
env: | ||
PLATFORM: darwin | ||
BUILD_VERSION: ${{ steps.get_version.outputs.VERSION }} | ||
|
||
- name: Upload binary | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: factotum_server_${{ steps.get_version.outputs.VERSION }}_darwin_x86_64.zip | ||
path: build/compiled/factotum_server_${{ steps.get_version.outputs.VERSION }}_darwin_x86_64.zip | ||
|
||
release: | ||
needs: ["ubuntu", "macos"] | ||
|
||
name: Release | ||
strategy: | ||
matrix: | ||
os: [ubuntu-18.04] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Create Release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Extract tag version from ref | ||
id: get_version | ||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | ||
|
||
- run: mkdir -p ./build/compiled | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: factotum_server_${{ steps.get_version.outputs.VERSION }}_linux_x86_64.zip | ||
path: build/compiled | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: factotum_server_${{ steps.get_version.outputs.VERSION }}_darwin_x86_64.zip | ||
path: build/compiled | ||
|
||
- name: Upload release binaries | ||
uses: alexellis/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
asset_paths: '["./build/compiled/*"]' |
This file contains 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,62 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
- '*/*' | ||
- '**' | ||
|
||
jobs: | ||
ubuntu: | ||
name: Compile & Test | ||
strategy: | ||
matrix: | ||
os: [ubuntu-18.04] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Install latest rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
default: true | ||
override: true | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Test | ||
run: make test | ||
|
||
- name: Build | ||
run: make debug | ||
|
||
- uses: Swatinem/rust-cache@v1 | ||
|
||
macos: | ||
name: Compile & Test | ||
strategy: | ||
matrix: | ||
os: [macos-10.15] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Install latest rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: x86_64-apple-darwin | ||
default: true | ||
override: true | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Test | ||
run: make test | ||
|
||
- name: Build | ||
run: make debug | ||
|
||
- uses: Swatinem/rust-cache@v1 |
This file contains 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 |
---|---|---|
|
@@ -16,3 +16,5 @@ Cargo.lock | |
.factotum | ||
.vagrant | ||
|
||
# Project | ||
build/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "factotum-server" | ||
version = "0.2.0" | ||
version = "0.3.0" | ||
authors = ["Nicholas Ung <[email protected]>", "Josh Beemster <[email protected]>"] | ||
|
||
[dependencies] | ||
|
This file contains 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,60 @@ | ||
.PHONY: debug release zip test check-env clean | ||
|
||
# ----------------------------------------------------------------------------- | ||
# CONSTANTS | ||
# ----------------------------------------------------------------------------- | ||
|
||
version = $(shell cat Cargo.toml | grep "^version = \"" | sed -n 's/^.*version = "\(.*\)".*/\1/p' | xargs) | ||
|
||
build_dir = build | ||
target_dir = target | ||
factotum_dir = .factotum | ||
|
||
compiled_dir = $(build_dir)/compiled | ||
|
||
# ----------------------------------------------------------------------------- | ||
# BUILDING | ||
# ----------------------------------------------------------------------------- | ||
|
||
debug: | ||
cargo build --verbose | ||
|
||
release: | ||
cargo build --verbose --release | ||
|
||
zip: release check-env | ||
ifeq ($(version),$(BUILD_VERSION)) | ||
mkdir -p $(compiled_dir) | ||
(cd target/release && zip -r staging.zip factotum-server) | ||
mv target/release/staging.zip $(compiled_dir)/factotum_server_$(version)_$(PLATFORM)_x86_64.zip | ||
else | ||
$(error BUILD_VERSION and Cargo.toml version do not match - cannot release) | ||
endif | ||
|
||
# ----------------------------------------------------------------------------- | ||
# TESTING | ||
# ----------------------------------------------------------------------------- | ||
|
||
test: | ||
cargo test --verbose | ||
|
||
# ----------------------------------------------------------------------------- | ||
# HELPERS | ||
# ----------------------------------------------------------------------------- | ||
|
||
check-env: | ||
ifndef PLATFORM | ||
$(error PLATFORM is undefined) | ||
endif | ||
ifndef BUILD_VERSION | ||
$(error BUILD_VERSION is undefined) | ||
endif | ||
|
||
# ----------------------------------------------------------------------------- | ||
# CLEANUP | ||
# ----------------------------------------------------------------------------- | ||
|
||
clean: | ||
rm -rf $(build_dir) | ||
rm -rf $(target_dir) | ||
rm -rf $(factotum_dir) |
Oops, something went wrong.