redsunlib/.github/workflows/rust.yml

56 lines
1.5 KiB
YAML
Raw Normal View History

2020-12-04 18:07:01 +13:00
name: Rust
on:
push:
branches: [master]
2020-12-04 18:07:01 +13:00
pull_request:
branches: [master]
2020-12-04 18:07:01 +13:00
env:
CARGO_TERM_COLOR: always
jobs:
build:
2021-02-25 07:44:50 +13:00
runs-on: ubuntu-18.04
2020-12-04 18:07:01 +13:00
steps:
- uses: actions/checkout@v2
- name: Cache Packages
uses: Swatinem/rust-cache@v1.0.1
- name: Build
run: cargo build --release
2021-03-27 16:00:47 +13:00
- uses: actions/upload-artifact@v2.2.1
name: Upload a Build Artifact
with:
name: libreddit
path: target/release/libreddit
2021-03-27 10:48:00 +13:00
- 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::$(git describe --tags)"
- name: Calculate SHA512 checksum
run: sha512sum target/release/libreddit > libreddit.sha512
2021-03-27 10:48:00 +13:00
- name: Release
uses: softprops/action-gh-release@v1
if: github.base_ref != 'master'
with:
2021-03-27 10:48:00 +13:00
tag_name: ${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.version }} - NAME
draft: true
files: |
target/release/libreddit
libreddit.sha512
2021-03-27 10:48:00 +13:00
body: |
- ${{ github.event.head_commit.message }} ${{ github.sha }}
2021-03-27 10:48:00 +13:00
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 }}