Skip to content

Commit

Permalink
feat(CI/CD): create release on new tag
Browse files Browse the repository at this point in the history
  • Loading branch information
TD-Sky committed Dec 2, 2023
1 parent b207a7b commit 4603813
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: release

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

env:
CARGO_TERM_COLOR: always

jobs:
release:
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
archive: tar.gz

runs-on: ${{ matrix.os }}
container:
image: ghcr.io/gtk-rs/gtk4-rs/gtk4:latest

steps:
- name: Install dependencies
if: matrix.os == 'ubuntu-latest'
run: yum install -y gtk4-devel libadwaita-devel

- uses: actions/checkout@v3

- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Cache Dependencies
uses: Swatinem/rust-cache@v2

- name: Build
run: cargo build --release --locked --target ${{ matrix.target }}

- name: Pack Artifacts
if: matrix.os == 'ubuntu-latest'
env:
RELEASE_NAME: satty-${{ matrix.target }}
ARTIFACTS_DIR: target/${{ matrix.target }}/release
run: |
mkdir $RELEASE_NAME
cp target/${{ matrix.target }}/release/satty -t $RELEASE_NAME
cp -r completions -t $RELEASE_NAME
cp -r README.md assets LICENSE satty.desktop -t $RELEASE_NAME
tar -zcvf $RELEASE_NAME.${{ matrix.archive }} -C $RELEASE_NAME .
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: satty-${{ matrix.target }}.${{ matrix.archive }}

0 comments on commit 4603813

Please sign in to comment.