Skip to content

Commit 929c18c

Browse files
committed
Scope env vars to the job definition that needs them
The variables that controlled the behavior of Rust programs and the output of `cargo` are only used in the `build-release` job, not in the `create-release` jobs, and one of them was already set in the more suitable narrower scope. This moves them to that scope, without duplication. They still apply to all steps in the build jobs. This also: - Adjusts comment wording to clarify how `CARGO` is set and used. - Quotes `1` as an environment variable value, since such values are always strings (it was being converted), but having it as a numeric YAML literal made it seem like that was not the case. - Adds spacing for clarity and for stylistic consistency across the two job definitions.
1 parent b9ded3a commit 929c18c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ on:
1212
tags:
1313
- 'v*'
1414

15-
env:
16-
RUST_BACKTRACE: 1
17-
CARGO_TERM_COLOR: always
18-
CLICOLOR: 1
19-
2015
defaults:
2116
run:
2217
shell: bash
@@ -27,10 +22,13 @@ jobs:
2722
# from building the release so that we only create the release once.
2823
create-release:
2924
name: create-release
25+
3026
runs-on: ubuntu-latest
27+
3128
# env:
3229
# # Set to force version number, e.g., when no tag exists.
3330
# VERSION: TEST-0.0.0
31+
3432
steps:
3533
- name: Create artifacts directory
3634
run: mkdir artifacts
@@ -133,10 +131,12 @@ jobs:
133131
runs-on: ${{ matrix.os }}
134132

135133
env:
136-
CARGO: cargo # On Linux, this will be changed to `cross` later.
134+
CARGO: cargo # On Linux, this will be changed to `cross` in a later step.
137135
TARGET_FLAGS: --target=${{ matrix.target }}
138136
TARGET_DIR: ./target/${{ matrix.target }}
139-
RUST_BACKTRACE: 1 # Emit backtraces on panics.
137+
RUST_BACKTRACE: '1' # Emit backtraces on panics.
138+
CARGO_TERM_COLOR: always
139+
CLICOLOR: '1'
140140

141141
steps:
142142
- name: Checkout repository

0 commit comments

Comments
 (0)