Skip to content

Commit dceb28a

Browse files
Merge pull request #1893 from kristof-mattei/lowercase-variable-names
chore: consolidation of scripts
2 parents fa89fa2 + 580b880 commit dceb28a

File tree

6 files changed

+40
-33
lines changed

6 files changed

+40
-33
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ permissions:
1717
packages: write
1818

1919
env:
20+
CARGO_TERM_COLOR: always
2021
# set this to true in GitHub variables to enable building the container
2122
# HAS_CONTAINER: true
2223
# Use docker.io for Docker Hub if empty
@@ -145,7 +146,7 @@ jobs:
145146
run: |
146147
version="$(cog bump --auto --dry-run || true)"
147148
148-
if [[ "$version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
149+
if [[ "${version}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
149150
echo "New version: ${version}"
150151
else
151152
version="v$(cog -v get-version)"

.github/workflows/publish-crate-after-release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
name: Publish crate
22

3-
env: {}
4-
53
concurrency:
64
group: "${{ github.workflow }}"
75
cancel-in-progress: false # last one must win in case of multiple releases
@@ -14,6 +12,9 @@ on:
1412
permissions:
1513
contents: read
1614

15+
env:
16+
CARGO_TERM_COLOR: always
17+
1718
jobs:
1819
repo-has-crate:
1920
name: Repo publishes crate?

.github/workflows/release.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
name: Release
22

3-
env:
4-
# Use docker.io for Docker Hub if empty
5-
REGISTRY: ghcr.io
6-
# github.repository as <account>/<repo>
7-
IMAGE_NAME: ${{ github.repository }}
8-
93
concurrency:
104
group: "${{ github.workflow }}"
115
cancel-in-progress: true # only last step is important, which runs or doesn't
@@ -19,6 +13,13 @@ permissions:
1913
issues: write
2014
pull-requests: write
2115

16+
env:
17+
CARGO_TERM_COLOR: always
18+
# Use docker.io for Docker Hub if empty
19+
REGISTRY: ghcr.io
20+
# github.repository as <account>/<repo>
21+
IMAGE_NAME: ${{ github.repository }}
22+
2223
jobs:
2324
release:
2425
name: Release
@@ -101,8 +102,8 @@ jobs:
101102
102103
cog bump --auto
103104
104-
VERSION="v$(cog -v get-version)"
105-
echo "version=$VERSION" >> $GITHUB_OUTPUT
105+
version="v$(cog -v get-version)"
106+
echo "version=$version" >> ${GITHUB_OUTPUT}
106107
107108
git push
108109

.github/workflows/retag-containers-after-push.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
name: Retag containers after new push / PR
22

3-
env:
4-
# set this to true in GitHub variables to enable building the container
5-
# HAS_CONTAINER: true
6-
# Use docker.io for Docker Hub if empty
7-
REGISTRY: ghcr.io
8-
# github.repository as <account>/<repo>
9-
IMAGE_NAME: ${{ github.repository }}
10-
113
concurrency:
124
group: "${{ github.workflow }}" # last one must win
135
cancel-in-progress: false # no we need them
@@ -31,6 +23,15 @@ permissions:
3123
contents: write
3224
packages: write
3325

26+
env:
27+
CARGO_TERM_COLOR: always
28+
# set this to true in GitHub variables to enable building the container
29+
# HAS_CONTAINER: true
30+
# Use docker.io for Docker Hub if empty
31+
REGISTRY: ghcr.io
32+
# github.repository as <account>/<repo>
33+
IMAGE_NAME: ${{ github.repository }}
34+
3435
jobs:
3536
repo-has-container:
3637
name: Repo has container?
@@ -76,6 +77,7 @@ jobs:
7677
7778
else
7879
echo "The incoming push isn't a merge, ergo it's not a PR"
80+
exit 1
7981
fi
8082
8183
- name: Download crane tar, extract, and add folder to path.
@@ -152,13 +154,13 @@ jobs:
152154
run: |
153155
# search for the tag, there can only be zero or one match
154156
# we need the || true because otherwise grep returns exit code 1 and github actions then dies
155-
pr_tag_found=$(cat existing_tags | grep -c "^${PR_TAG}\$") || true
157+
pr_tag_found=$(cat existing_tags | grep -c "^${{ env.PR_TAG }}\$") || true
156158
157159
if [ $pr_tag_found -eq 1 ]
158160
then
159161
echo "Incoming PR produced a Docker image"
160162
161-
echo "OLD_TAG=${PR_TAG}" >> ${GITHUB_ENV}
163+
echo "OLD_TAG=${{ env.PR_TAG }}" >> ${GITHUB_ENV}
162164
echo "SUFFIX=actual" >> ${GITHUB_ENV}
163165
else
164166
# If we don't have an old tag, then the incoming PR didn't produce a container.

.github/workflows/retag-containers-after-release.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
name: Update semantic tags on repo & image after release
22

3-
env:
4-
# Use docker.io for Docker Hub if empty
5-
REGISTRY: ghcr.io
6-
# github.repository as <account>/<repo>
7-
IMAGE_NAME: ${{ github.repository }}
8-
93
concurrency:
104
group: "${{ github.workflow }}"
115
cancel-in-progress: false # last one must win in case of multiple releases
@@ -19,6 +13,13 @@ permissions:
1913
contents: write
2014
packages: write
2115

16+
env:
17+
CARGO_TERM_COLOR: always
18+
# Use docker.io for Docker Hub if empty
19+
REGISTRY: ghcr.io
20+
# github.repository as <account>/<repo>
21+
IMAGE_NAME: ${{ github.repository }}
22+
2223
jobs:
2324
repo-has-container:
2425
name: Repo has container?

.github/workflows/test-release.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
name: Test Release
22

3-
env:
4-
# Use docker.io for Docker Hub if empty
5-
REGISTRY: ghcr.io
6-
# github.repository as <account>/<repo>
7-
IMAGE_NAME: ${{ github.repository }}
8-
93
on:
104
workflow_dispatch: # releasing is manual as we don't want to release every time
115

@@ -14,6 +8,13 @@ permissions:
148
issues: read
159
pull-requests: read
1610

11+
env:
12+
CARGO_TERM_COLOR: always
13+
# Use docker.io for Docker Hub if empty
14+
REGISTRY: ghcr.io
15+
# github.repository as <account>/<repo>
16+
IMAGE_NAME: ${{ github.repository }}
17+
1718
jobs:
1819
test-release:
1920
name: Test Release

0 commit comments

Comments
 (0)