Skip to content
This repository was archived by the owner on Aug 9, 2022. It is now read-only.

Commit c7beef1

Browse files
authored
ci: add release.yml (#38)
1 parent bee0c1d commit c7beef1

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

.github/workflows/release.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: release
2+
3+
on:
4+
push:
5+
# Sequence of patterns matched against refs/tags
6+
tags:
7+
- "v*" # Any tag will cause release
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
release-info:
14+
name: Release
15+
runs-on: ubuntu-latest
16+
# info used for release
17+
outputs:
18+
upload_url: ${{ steps.create-release.outputs.upload_url }}
19+
tag: ${{ steps.get-tag.outputs.tag }}
20+
steps:
21+
- name: Release
22+
id: create-release
23+
uses: actions/create-release@v1
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
with:
27+
tag_name: ${{ github.ref }}
28+
release_name: Release ${{ github.ref }}
29+
draft: false
30+
prerelease: false
31+
- name: Get Tag
32+
id: get-tag
33+
uses: olegtarasov/get-tag@v2.1
34+
35+
echo-info:
36+
name: Echo Info
37+
needs: release-info
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Echo Info
41+
run: |
42+
echo elara-kv-${{ needs.release-info.outputs.tag }}
43+
echo url:${{ needs.release-info.outputs.upload_url }}
44+
45+
release-linux:
46+
name: Release on Ubuntu
47+
# we need to know the upload URL
48+
needs: release-info
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions-rs/toolchain@v1
52+
with:
53+
toolchain: stable
54+
override: true
55+
- uses: actions/checkout@v1
56+
- name: Build
57+
run: |
58+
git submodule update --init --remote
59+
cargo build --release
60+
61+
- name: Upload linux version
62+
uses: actions/upload-release-asset@v1.0.1
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
with:
66+
upload_url: ${{ needs.release-info.outputs.upload_url }}
67+
asset_path: ./target/release/elara-kv
68+
asset_name: elara-kv-${{ needs.release-info.outputs.tag }}-x86_64-ubuntu
69+
asset_content_type: application/octet-stream
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build
1+
name: test
22

33
on:
44
push:

0 commit comments

Comments
 (0)