Skip to content

Commit 57e6c5f

Browse files
authored
.github, fetch-configlet: rename release assets (#705)
Before this commit, the release assets were named like: configlet-linux-64bit.tgz configlet-mac-64bit.tgz configlet-windows-64bit.zip configlet_4.0.0-beta.7_checksums_sha256.txt With this commit, the next release will have assets named: configlet_4.0.0-beta.8_checksums_sha256.txt configlet_4.0.0-beta.8_linux_x86-64.tar.gz configlet_4.0.0-beta.8_macos_x86-64.tar.gz configlet_4.0.0-beta.8_windows_x86-64.zip Where we: - Make the archive naming format match that of the checksums file - Add a version string - Delimit with an underscore, not a hyphen - Rename `64bit` to `x86-64` - Rename `32bit` to `i386` - Rename `tgz` to `tar.gz` - Rename `mac` to `macos` So far, we have only released configlet for x86-64, and the release assets have always had an ambiguous `64bit` in the names. This naming format was old (added by d4c6e26, 2020-10-09), and was ultimately inherited from: - the `exercism/configlet-v2` releases [1] - the `exercism/cli` releases [2][3] However, we're getting closer to adding releases for other 64-bit architectures, so it's especially important to change the names now. The rationale for the particular use of underscores and hyphens is: - We want to have the version string in the asset filenames - Configlet uses version strings that are compatible with the Semantic Versioning spec - It is more common to use hyphens in executable names than underscores - The Semantic Versioning spec forbids using an underscore, and specifies that prerelease versions can use hyphens [4]: Section 9: A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version. Identifiers MUST comprise only ASCII alphanumerics and hyphens [0-9A-Za-z-]. [...] Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92 That is, there's an argument for the format of: some-app_1.0.0-beta.1_linux_x86-64.tar.gz rather than: some_app-1.0.0-beta.1-linux-x86_64.tar.gz because `_` fully separates the components of the first, and `-` does not separate the components of the second (due to the `-beta` part of the version string). This does ignore the convention of `_` as an inter-word space, however. [1] https://github.com/exercism/v2-configlet/releases [2] exercism/cli#700 (comment) [3] https://github.com/exercism/cli/releases/tag/v3.0.12 [4] https://semver.org/ Closes: #363 Refs: #24
1 parent 8907279 commit 57e6c5f

File tree

6 files changed

+23
-22
lines changed

6 files changed

+23
-22
lines changed

.github/bin/create-artifact

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ artifacts_dir='artifacts'
44
mkdir -p "${artifacts_dir}"
55

66
binary_name='configlet'
7+
build_tag="${GITHUB_REF_NAME}"
78

89
case "${OS}" in
910
windows)
10-
artifact_file="${artifacts_dir}/${binary_name}-${OS}-${ARCH}.zip"
11+
artifact_file="${artifacts_dir}/${binary_name}_${build_tag}_${OS}_${ARCH}.zip"
1112
7z a "${artifact_file}" "${binary_name}.exe"
1213
;;
13-
linux | mac)
14-
artifact_file="${artifacts_dir}/${binary_name}-${OS}-${ARCH}.tgz"
14+
linux | macos)
15+
artifact_file="${artifacts_dir}/${binary_name}_${build_tag}_${OS}_${ARCH}.tar.gz"
1516
tar -cvzf "${artifact_file}" "${binary_name}"
1617
;;
1718
esac

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ jobs:
1414
include:
1515
- os: linux
1616
runs-on: ubuntu-22.04
17-
arch: 64bit
17+
arch: x86-64
1818

19-
- os: mac
19+
- os: macos
2020
runs-on: macos-12
21-
arch: 64bit
21+
arch: x86-64
2222

2323
- os: windows
2424
runs-on: windows-2022
25-
arch: 64bit
25+
arch: x86-64
2626

2727
name: "${{ matrix.os }}-${{ matrix.arch }}"
2828
runs-on: ${{ matrix.runs-on }}

.github/workflows/fetch-configlet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- os: linux
1919
runs-on: ubuntu-22.04
2020

21-
- os: mac
21+
- os: macos
2222
runs-on: macos-12
2323

2424
- os: windows

.github/workflows/tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ jobs:
1919
include:
2020
- os: linux
2121
runs-on: ubuntu-22.04
22-
arch: 64bit
22+
arch: x86-64
2323

24-
- os: mac
24+
- os: macos
2525
runs-on: macos-12
26-
arch: 64bit
26+
arch: x86-64
2727

2828
- os: windows
2929
runs-on: windows-2022
30-
arch: 64bit
30+
arch: x86-64
3131

3232
name: "${{ matrix.os }}-${{ matrix.arch }}"
3333
runs-on: ${{ matrix.runs-on }}

scripts/fetch-configlet

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ get_download_url() {
2424
local latest='https://api.github.com/repos/exercism/configlet/releases/latest'
2525
local arch
2626
case "$(uname -m)" in
27-
*64*) arch='64bit' ;;
28-
*686*) arch='32bit' ;;
29-
*386*) arch='32bit' ;;
30-
*) arch='64bit' ;;
27+
x86_64) arch='x86-64' ;;
28+
*686*) arch='i386' ;;
29+
*386*) arch='i386' ;;
30+
*) arch='x86-64' ;;
3131
esac
32-
local suffix="${os}-${arch}.${ext}"
32+
local suffix="${os}_${arch}.${ext}"
3333
curl "${curlopts[@]}" --header 'Accept: application/vnd.github.v3+json' "${latest}" |
3434
grep "\"browser_download_url\": \".*/download/.*/configlet.*${suffix}\"$" |
3535
cut -d'"' -f4
@@ -48,7 +48,7 @@ main() {
4848

4949
local os
5050
case "$(uname)" in
51-
Darwin*) os='mac' ;;
51+
Darwin*) os='macos' ;;
5252
Linux*) os='linux' ;;
5353
Windows*) os='windows' ;;
5454
MINGW*) os='windows' ;;
@@ -58,8 +58,8 @@ main() {
5858

5959
local ext
6060
case "${os}" in
61-
windows*) ext='zip' ;;
62-
*) ext='tgz' ;;
61+
windows*) ext='zip' ;;
62+
*) ext='tar.gz' ;;
6363
esac
6464

6565
echo "Fetching configlet..." >&2

scripts/fetch-configlet.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ $requestOpts = @{
1212
RetryIntervalSec = 1
1313
}
1414

15-
$arch = If ([Environment]::Is64BitOperatingSystem) { "64bit" } Else { "32bit" }
16-
$fileName = "configlet-windows-$arch.zip"
15+
$arch = If ([Environment]::Is64BitOperatingSystem) { "x86-64" } Else { "i386" }
16+
$fileName = "configlet_.+_windows_$arch.zip"
1717

1818
Function Get-DownloadUrl {
1919
$latestUrl = "https://api.github.com/repos/exercism/configlet/releases/latest"

0 commit comments

Comments
 (0)