49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
name: Rust
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-18.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Cache Packages
|
|
uses: Swatinem/rust-cache@v1.0.1
|
|
|
|
- name: Build
|
|
run: cargo build --release
|
|
|
|
- uses: actions/upload-artifact@v2.2.1
|
|
name: Upload a Build Artifact
|
|
with:
|
|
name: libreddit
|
|
path: target/release/libreddit
|
|
|
|
- name: Versions
|
|
id: version
|
|
run: |
|
|
echo "::set-output name=version::$(cargo metadata --format-version 1 --no-deps | jq .packages[0].version -r | sed 's/^/v/')"
|
|
echo "::set-output name=tag::${GITHUB_REF#refs/*/}"
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
tag_name: ${{ steps.version.outputs.version }}
|
|
name: ${{ steps.version.outputs.version }} - NAME
|
|
draft: true
|
|
files: target/release/libreddit
|
|
body: |
|
|
- CHANGES
|
|
|
|
See full list of changes [here](https://github.com/spikecodes/libreddit/compare/${{ steps.version.outputs.tag }}...${{ steps.version.outputs.version }}).
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|