-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (53 loc) · 1.65 KB
/
release.yml
File metadata and controls
56 lines (53 loc) · 1.65 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
name: release
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+-[0-9]+"
pull_request:
permissions:
contents: write
jobs:
get-id:
runs-on: ubuntu-latest
outputs:
uid_gid: ${{ steps.get-user.outputs.uid_gid }}
steps:
- id: get-user
run: echo "::set-output name=uid_gid::$(id -u):$(id -g)"
upload-assets:
needs: get-id
runs-on: ubuntu-latest
container:
image: messense/manylinux_2_31-cross:riscv64
options: --user ${{ needs.get-id.outputs.uid_gid }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: get-upstream-tag
run: |
tag=$(echo ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || '$(git describe --tags --abbrev=0)' }} | cut -d- -f1)
echo "::set-output name=tag::$tag"
- uses: actions/checkout@v4
with:
repository: 'BurntSushi/ripgrep'
ref: refs/tags/${{ steps.get-upstream-tag.outputs.tag }}
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: riscv64gc-unknown-linux-gnu
- name: Build ripgrep
env:
CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER: riscv64-unknown-linux-gnu-gcc
run: |
cargo build --target riscv64gc-unknown-linux-gnu -F pcre2 --release --bin rg
mkdir -p out
mv target/riscv64gc-unknown-linux-gnu/release/rg out/rg
- name: Strip ripgrep
run: |
riscv64-unknown-linux-gnu-strip out/rg
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: out/rg