-
Notifications
You must be signed in to change notification settings - Fork 1
116 lines (99 loc) · 3.81 KB
/
prebuild.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: prebuild
on:
push:
tags:
- 'v*'
jobs:
prerelease:
runs-on: ubuntu-20.04
steps:
- name: get the current version tag
run: echo "PUSHED_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: pre release draft
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.PUSHED_TAG }}
release_name: ${{ env.PUSHED_TAG }}
draft: true
prerelease: true
- name: prep a release upload url artifact
run: echo "${{ steps.create_release.outputs.upload_url }}" > ./release_upload_url.txt
- name: upload the release upload url artifact
uses: actions/[email protected]
with:
name: release_upload_url
path: ./release_upload_url.txt
prebuild:
needs: prerelease
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-20.04
- macos-10.15
# - windows-2019 # windows fails compilin' pqcrypto
steps:
- uses: actions/[email protected]
- name: get the current version tag
run: echo "PUSHED_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: make sure a correct rust version is installed
uses: hecrj/[email protected]
with:
rust-version: "1.55.0"
- name: build falcon-cli
run: cargo build --release --manifest-path=./Cargo.toml
- name: gzipup the binary
if: ${{ matrix.os != 'windows-2019' }}
run: gzip -c ./target/release/falcon > ./falcon.gz
- name: sha256sum the gzipd binary
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: sha256sum -b ./falcon.gz | grep -oE '^[a-f0-9]+' > ./falcon.gz.sha256sum
- name: download the release upload url artifact
uses: actions/[email protected]
with:
name: release_upload_url
- name: set the release upload url as an env var
run: echo "RELEASE_UPLOAD_URL=$(<./release_upload_url.txt)" >> $GITHUB_ENV
- name: upload the ubuntu binary's sha256sum
if: ${{ matrix.os == 'ubuntu-20.04' }}
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.RELEASE_UPLOAD_URL }}
asset_path: ./falcon.gz.sha256sum
asset_name: falcon-cli-${{ env.PUSHED_TAG }}-x86_64-unknown-linux-gnu.gz.sha256sum
asset_content_type: application/gzip
- name: upload the ubuntu binary
if: ${{ matrix.os == 'ubuntu-20.04' }}
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.RELEASE_UPLOAD_URL }}
asset_path: ./falcon.gz
asset_name: falcon-cli-${{ env.PUSHED_TAG }}-x86_64-unknown-linux-gnu.gz
asset_content_type: application/gzip
- name: upload the macos binary
if: ${{ matrix.os == 'macos-10.15' }}
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.RELEASE_UPLOAD_URL }}
asset_path: ./falcon.gz
asset_name: falcon-cli-${{ env.PUSHED_TAG }}-x86_64-apple-darwin.gz
asset_content_type: application/gzip
# - name: upload the windows binary
# if: ${{ matrix.os == 'windows-2019' }}
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ env.RELEASE_UPLOAD_URL }}
# asset_path: ./target/release/falcon-cli
# asset_name: falcon-cli-${{ env.PUSHED_TAG }}-x86_64-pc-windows-msvc
# asset_content_type: application/octet-stream