Skip to content

Commit

Permalink
Prepare repo for publishing - name change, workflow, license, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-kirby committed Jan 17, 2021
1 parent 1eaf57f commit 512a0ce
Show file tree
Hide file tree
Showing 8 changed files with 917 additions and 29 deletions.
2 changes: 0 additions & 2 deletions .cargo/config

This file was deleted.

172 changes: 172 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
name: workflow

on:
push:
branches:
- main

jobs:
fmt:
name: Format
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
profile: minimal
override: true

- name: rustfmt
run: cargo fmt --all -- --check

clippy:
name: Clippy
needs: [fmt]
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install toolchain
id: toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
profile: minimal
override: true

- name: Setup cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-rustc-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}

- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

release:
name: Create Release
needs: [fmt, clippy]
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}

steps:
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.sha }}
release_name: Release ${{ github.sha }}
draft: true
prerelease: false

build:
name: Build for ${{ matrix.os }}
needs: [fmt, clippy, release]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]

steps:
- name: Checkout
uses: actions/checkout@v2


- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Setup cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-rustc-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release

- name: Zip
run: |
7z a -tzip ${{ github.workspace }}/taskinator-${{ runner.os }}-${{ github.sha }}.zip ${{ github.workspace }}/target/release/taskinator
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/taskinator-${{ runner.os }}-${{ github.sha }}.zip
asset_name: taskinator-${{ runner.os }}-${{ github.sha }}.zip
asset_content_type: application/octet-stream

build_win:
name: Build for windows-latest
needs: [fmt, clippy, release]
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v2


- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Setup cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-rustc-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release

- name: Zip
run: |
7z a -tzip ${{ github.workspace }}/taskinator-${{ runner.os }}-${{ github.sha }}.zip ${{ github.workspace }}/target/release/taskinator.exe
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/taskinator-${{ runner.os }}-${{ github.sha }}.zip
asset_name: taskinator-${{ runner.os }}-${{ github.sha }}.zip
asset_content_type: application/octet-stream
44 changes: 22 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
name = "among-us"
version = "0.1.0"
name = "taskinator"
version = "0.2.0"
authors = ["Sam Kirby <[email protected]>"]
edition = "2018"
license = "AGPL-3.0-or-later"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
Loading

0 comments on commit 512a0ce

Please sign in to comment.