2020-12-04 18:07:01 +13:00
|
|
|
name: Rust
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-11-22 19:46:01 +13:00
|
|
|
paths-ignore:
|
|
|
|
- "**.md"
|
|
|
|
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:
|
2020-12-08 08:05:00 +13:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Cache Packages
|
|
|
|
uses: Swatinem/rust-cache@v1.0.1
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: cargo build --release
|
2021-12-28 10:53:58 +13:00
|
|
|
|
|
|
|
- name: Publish to crates.io
|
2021-12-28 11:21:06 +13:00
|
|
|
continue-on-error: true
|
2021-12-28 10:53:58 +13:00
|
|
|
run: cargo publish --no-verify --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
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/')"
|
2021-04-17 09:47:42 +12:00
|
|
|
echo "::set-output name=tag::$(git describe --tags)"
|
2021-03-28 09:11:05 +13:00
|
|
|
|
|
|
|
- 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
|
2021-05-10 13:13:24 +12:00
|
|
|
if: github.base_ref != 'master'
|
2020-12-08 08:05:00 +13:00
|
|
|
with:
|
2021-03-27 10:48:00 +13:00
|
|
|
tag_name: ${{ steps.version.outputs.version }}
|
2021-12-28 07:15:25 +13:00
|
|
|
name: ${{ steps.version.outputs.version }} - ${{ github.event.head_commit.message }}
|
2021-03-27 10:48:00 +13:00
|
|
|
draft: true
|
2021-03-28 09:11:05 +13:00
|
|
|
files: |
|
|
|
|
target/release/libreddit
|
|
|
|
libreddit.sha512
|
2021-03-27 10:48:00 +13:00
|
|
|
body: |
|
2021-12-28 07:15:25 +13:00
|
|
|
- ${{ github.event.head_commit.message }} ${{ github.sha }}
|
|
|
|
generate_release_notes: true
|
2021-03-27 10:48:00 +13:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|