-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (48 loc) · 1.7 KB
/
build.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
name: Build Release
on:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: create release tarball
run: |
mkdir wwwtech-${{ steps.get_version.outputs.VERSION }}
cp target/release/wwwtech_rs wwwtech-${{ steps.get_version.outputs.VERSION }}/
cp -r static/ wwwtech-${{ steps.get_version.outputs.VERSION }}/static
tar -czf wwwtech-${{ steps.get_version.outputs.VERSION }}.tgz wwwtech-${{ steps.get_version.outputs.VERSION }}/
- name: create github release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: Release ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./wwwtech-${{ steps.get_version.outputs.VERSION }}.tgz
asset_name: wwwtech-${{ steps.get_version.outputs.VERSION }}.tgz
asset_content_type: application/gzip