-
-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (75 loc) · 2.29 KB
/
Copy pathrelease.yml
File metadata and controls
85 lines (75 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag_name:
description: 'Tag name for release (e.g. v0.2.4)'
required: false
type: string
permissions:
contents: write
jobs:
build-release:
name: Build and Release Binary
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwayland-dev \
wayland-protocols \
libxkbcommon-dev \
libegl-dev \
libgles-dev \
libx11-dev \
libasound2-dev \
libudev-dev \
libavcodec-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
pkg-config
- name: Install stable Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry and build artifacts
uses: Swatinem/rust-cache@v2
with:
key: release
- name: Build release binary
run: cargo build --release --bin wallr
- name: Prepare Release Asset
run: |
mkdir -p staging
cp target/release/wallr staging/
cp README.md staging/
cp -r docs staging/
cd staging
tar -czf ../wallr-linux-amd64.tar.gz *
cd ..
- name: Determine Tag
id: determine_tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ inputs.tag_name }}" ]; then
echo "TAG_NAME=${{ inputs.tag_name }}" >> $GITHUB_ENV
elif [ "${{ github.ref_type }}" = "tag" ]; then
echo "TAG_NAME=${{ github.ref_name }}" >> $GITHUB_ENV
else
echo "TAG_NAME=v$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name=="wallr") | .version')" >> $GITHUB_ENV
fi
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.TAG_NAME }}
name: Release ${{ env.TAG_NAME }}
draft: false
prerelease: false
files: |
wallr-linux-amd64.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}