9
9
create-release :
10
10
name : create-release
11
11
runs-on : ubuntu-latest
12
+ outputs :
13
+ upload_url : ${{ steps.release.outputs.upload_url }}
14
+ rg_version : ${{ env.RG_VERSION }}
12
15
steps :
13
- - name : Create artifacts directory
14
- run : mkdir artifacts
15
-
16
16
- name : Get the release version from the tag
17
+ shell : bash
17
18
if : env.ACRE_VERSION == ''
18
19
run : |
19
20
# Apparently, this is the right way to get a tag name. Really?
20
21
#
21
22
# See: https://github.community/t5/GitHub-Actions/How-to-get-just-the-tag-name/m-p/32167/highlight/true#M1027
22
- echo "::set-env name= ACRE_VERSION:: ${GITHUB_REF#refs/tags/}"
23
+ echo "ACRE_VERSION= ${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
23
24
echo "version is: ${{ env.ACRE_VERSION }}"
24
25
- name : Create GitHub release
25
26
id : release
30
31
tag_name : ${{ env.ACRE_VERSION }}
31
32
release_name : ${{ env.ACRE_VERSION }}
32
33
33
- - name : Save release upload URL to artifact
34
- run : echo "${{ steps.release.outputs.upload_url }}" > artifacts/release-upload-url
35
-
36
- - name : Save version number to artifact
37
- run : echo "${{ env.ACRE_VERSION }}" > artifacts/release-version
38
-
39
- - name : Upload artifacts
40
- uses : actions/upload-artifact@v1
41
- with :
42
- name : artifacts
43
- path : artifacts
44
-
45
34
build-release :
46
35
name : build-release
47
36
needs : ['create-release']
@@ -62,11 +51,11 @@ jobs:
62
51
include :
63
52
- build : linux
64
53
os : ubuntu-18.04
65
- rust : nightly
54
+ rust : stable
66
55
target : x86_64-unknown-linux-musl
67
56
- build : macos
68
57
os : macos-latest
69
- rust : nightly
58
+ rust : stable
70
59
target : x86_64-apple-darwin
71
60
72
61
steps :
@@ -84,34 +73,19 @@ jobs:
84
73
target : ${{ matrix.target }}
85
74
86
75
- name : Use Cross
87
- # if: matrix.os != 'windows-2019'
76
+ shell : bash
88
77
run : |
89
- # FIXME: to work around bugs in latest cross release, install master.
90
- # See: https://github.com/rust-embedded/cross/issues/357
91
- cargo install --git https://github.com/rust-embedded/cross
92
- echo "::set-env name=CARGO::cross"
93
- echo "::set-env name=TARGET_FLAGS::--target ${{ matrix.target }}"
94
- echo "::set-env name=TARGET_DIR::./target/${{ matrix.target }}"
78
+ cargo install cross
79
+ echo "CARGO=cross" >> $GITHUB_ENV
80
+ echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
81
+ echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
82
+
95
83
- name : Show command used for Cargo
96
84
run : |
97
85
echo "cargo command is: ${{ env.CARGO }}"
98
86
echo "target flag is: ${{ env.TARGET_FLAGS }}"
99
87
echo "target dir is: ${{ env.TARGET_DIR }}"
100
- - name : Get release download URL
101
- uses : actions/download-artifact@v1
102
- with :
103
- name : artifacts
104
- path : artifacts
105
88
106
- - name : Set release upload URL and release version
107
- shell : bash
108
- run : |
109
- release_upload_url="$(cat artifacts/release-upload-url)"
110
- echo "::set-env name=RELEASE_UPLOAD_URL::$release_upload_url"
111
- echo "release upload url: $RELEASE_UPLOAD_URL"
112
- release_version="$(cat artifacts/release-version)"
113
- echo "::set-env name=RELEASE_VERSION::$release_version"
114
- echo "release version: $RELEASE_VERSION"
115
89
- name : Build release binary
116
90
run : ${{ env.CARGO }} build --verbose --release ${{ env.TARGET_FLAGS }}
117
91
124
98
env :
125
99
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
126
100
with :
127
- upload_url : ${{ env.RELEASE_UPLOAD_URL }}
101
+ upload_url : ${{ needs.create-release.outputs.upload_url }}
128
102
asset_path : target/${{ matrix.target }}/release/acre
129
103
asset_name : acre-${{ matrix.build }}
130
104
asset_content_type : application/octet-stream
0 commit comments