Skip to content

Commit 95913a8

Browse files
committed
workflow stuff
1 parent 4cdfaa2 commit 95913a8

File tree

2 files changed

+17
-41
lines changed

2 files changed

+17
-41
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@ jobs:
99
create-release:
1010
name: create-release
1111
runs-on: ubuntu-latest
12+
outputs:
13+
upload_url: ${{ steps.release.outputs.upload_url }}
14+
rg_version: ${{ env.RG_VERSION }}
1215
steps:
13-
- name: Create artifacts directory
14-
run: mkdir artifacts
15-
1616
- name: Get the release version from the tag
17+
shell: bash
1718
if: env.ACRE_VERSION == ''
1819
run: |
1920
# Apparently, this is the right way to get a tag name. Really?
2021
#
2122
# 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
2324
echo "version is: ${{ env.ACRE_VERSION }}"
2425
- name: Create GitHub release
2526
id: release
@@ -30,18 +31,6 @@ jobs:
3031
tag_name: ${{ env.ACRE_VERSION }}
3132
release_name: ${{ env.ACRE_VERSION }}
3233

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-
4534
build-release:
4635
name: build-release
4736
needs: ['create-release']
@@ -62,11 +51,11 @@ jobs:
6251
include:
6352
- build: linux
6453
os: ubuntu-18.04
65-
rust: nightly
54+
rust: stable
6655
target: x86_64-unknown-linux-musl
6756
- build: macos
6857
os: macos-latest
69-
rust: nightly
58+
rust: stable
7059
target: x86_64-apple-darwin
7160

7261
steps:
@@ -84,34 +73,19 @@ jobs:
8473
target: ${{ matrix.target }}
8574

8675
- name: Use Cross
87-
# if: matrix.os != 'windows-2019'
76+
shell: bash
8877
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+
9583
- name: Show command used for Cargo
9684
run: |
9785
echo "cargo command is: ${{ env.CARGO }}"
9886
echo "target flag is: ${{ env.TARGET_FLAGS }}"
9987
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
10588
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"
11589
- name: Build release binary
11690
run: ${{ env.CARGO }} build --verbose --release ${{ env.TARGET_FLAGS }}
11791

@@ -124,7 +98,7 @@ jobs:
12498
env:
12599
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
126100
with:
127-
upload_url: ${{ env.RELEASE_UPLOAD_URL }}
101+
upload_url: ${{ needs.create-release.outputs.upload_url }}
128102
asset_path: target/${{ matrix.target }}/release/acre
129103
asset_name: acre-${{ matrix.build }}
130104
asset_content_type: application/octet-stream

Cargo.lock

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)