/
action.yml
67 lines (66 loc) · 2.35 KB
/
action.yml
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
name: "Build Quickwit binary with cargo cross"
description: "Build React app and Rust binary with cargo cross."
inputs:
target:
description: "Target"
required: true
version:
description: "Binary version"
required: true
token:
description: "GitHub access token"
required: true
runs:
using: "composite"
steps:
- run: echo "ASSET_FULL_NAME=quickwit-${{ inputs.version }}-${{ inputs.target }}" >> $GITHUB_ENV
shell: bash
- uses: actions/setup-node@v3
with:
node-version: 20
cache: "yarn"
cache-dependency-path: quickwit/quickwit-ui/yarn.lock
- run: yarn global add node-gyp
shell: bash
- run: make build-ui
shell: bash
- name: Install rustup
shell: bash
run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain none -y
- name: Install cross
run: cargo install cross
shell: bash
- name: Retrieve and export commit date, hash, and tags
run: |
echo "QW_COMMIT_DATE=$(TZ=UTC0 git log -1 --format=%cd --date=format-local:%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_ENV
echo "QW_COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV
echo "QW_COMMIT_TAGS=$(git tag --points-at HEAD | tr '\n' ',')" >> $GITHUB_ENV
shell: bash
- name: Build Quickwit
run: cross build --release --features release-feature-vendored-set --target ${{ inputs.target }} --bin quickwit
shell: bash
env:
QW_COMMIT_DATE: ${{ env.QW_COMMIT_DATE }}
QW_COMMIT_HASH: ${{ env.QW_COMMIT_HASH }}
QW_COMMIT_TAGS: ${{ env.QW_COMMIT_TAGS }}
working-directory: ./quickwit
- name: Bundle archive
run: |
make archive BINARY_FILE=quickwit/target/${{ inputs.target }}/release/quickwit \
BINARY_VERSION=${{ inputs.version }} ARCHIVE_NAME=${{ env.ASSET_FULL_NAME }}
shell: bash
- name: Save binary archive for three days
uses: actions/upload-artifact@v3
with:
name: ${{ env.ASSET_FULL_NAME }}.tar.gz
path: ./${{ env.ASSET_FULL_NAME }}.tar.gz
retention-days: 3
- name: Upload archive
uses: quickwit-inc/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ inputs.token }}
with:
file: ${{ env.ASSET_FULL_NAME }}.tar.gz
overwrite: true
draft: ${{ inputs.version != 'nightly' }}
tag_name: ${{ inputs.version }}