mirror of
https://github.com/NotAShelf/stash.git
synced 2026-04-12 22:17:41 +00:00
ci: publish tagged releases
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I6a6a6964901463c7111df0764272c26ff83eea9f
This commit is contained in:
parent
c23c5af8c1
commit
7dd3db4c88
1 changed files with 104 additions and 0 deletions
104
.github/workflows/release.yaml
vendored
Normal file
104
.github/workflows/release.yaml
vendored
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
name: Publish Built Binaries
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
create-release:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
release_id: ${{ steps.create_release.outputs.id }}
|
||||
steps:
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
draft: false
|
||||
prerelease: false
|
||||
generate_release_notes: true
|
||||
|
||||
build-release:
|
||||
needs: create-release
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
target: x86_64-unknown-linux-gnu
|
||||
name: stash-linux-amd64
|
||||
cross: false
|
||||
- os: ubuntu-latest
|
||||
target: aarch64-unknown-linux-gnu
|
||||
name: stash-linux-arm64
|
||||
cross: true
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Setup cross-compilation (Linux ARM64)
|
||||
if: matrix.cross && matrix.os == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gcc-aarch64-linux-gnu
|
||||
|
||||
- name: Install cross
|
||||
if: matrix.cross
|
||||
uses: taiki-e/install-action@v2
|
||||
with:
|
||||
tool: cross
|
||||
|
||||
- name: Build binary (native)
|
||||
if: ${{ !matrix.cross }}
|
||||
run: cargo build --release --target ${{ matrix.target }}
|
||||
|
||||
- name: Build binary (cross)
|
||||
if: ${{ matrix.cross }}
|
||||
run: cross build --release --target ${{ matrix.target }}
|
||||
|
||||
- name: Prepare binary (Unix)
|
||||
if: ${{ !contains(matrix.os, 'windows') }}
|
||||
run: |
|
||||
cp target/${{ matrix.target }}/release/stash ${{ matrix.name }}
|
||||
|
||||
- name: Upload Release Asset
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: ${{ matrix.name }}
|
||||
|
||||
generate-checksums:
|
||||
needs: [create-release, build-release]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Download Assets
|
||||
uses: robinraju/release-downloader@v1
|
||||
with:
|
||||
tag: ${{ github.ref_name }}
|
||||
fileName: "stash-*"
|
||||
out-file-path: "."
|
||||
|
||||
- name: Generate checksums
|
||||
run: |
|
||||
sha256sum stash-* > SHA256SUMS
|
||||
|
||||
- name: Upload Checksums
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: SHA256SUMS
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue