diff --git a/.github/bin/create-artifact b/.github/bin/create-artifact index 71e28cac..39da0d9d 100755 --- a/.github/bin/create-artifact +++ b/.github/bin/create-artifact @@ -4,14 +4,15 @@ artifacts_dir='artifacts' mkdir -p "${artifacts_dir}" binary_name='configlet' +build_tag="${GITHUB_REF_NAME}" case "${OS}" in windows) - artifact_file="${artifacts_dir}/${binary_name}-${OS}-${ARCH}.zip" + artifact_file="${artifacts_dir}/${binary_name}_${build_tag}_${OS}_${ARCH}.zip" 7z a "${artifact_file}" "${binary_name}.exe" ;; - linux | mac) - artifact_file="${artifacts_dir}/${binary_name}-${OS}-${ARCH}.tgz" + linux | macos) + artifact_file="${artifacts_dir}/${binary_name}_${build_tag}_${OS}_${ARCH}.tar.gz" tar -cvzf "${artifact_file}" "${binary_name}" ;; esac diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 464813f2..40f87092 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,15 +14,15 @@ jobs: include: - os: linux runs-on: ubuntu-22.04 - arch: 64bit + arch: x86-64 - - os: mac + - os: macos runs-on: macos-12 - arch: 64bit + arch: x86-64 - os: windows runs-on: windows-2022 - arch: 64bit + arch: x86-64 name: "${{ matrix.os }}-${{ matrix.arch }}" runs-on: ${{ matrix.runs-on }} diff --git a/.github/workflows/fetch-configlet.yml b/.github/workflows/fetch-configlet.yml index 1b96ee90..b3a79077 100644 --- a/.github/workflows/fetch-configlet.yml +++ b/.github/workflows/fetch-configlet.yml @@ -18,7 +18,7 @@ jobs: - os: linux runs-on: ubuntu-22.04 - - os: mac + - os: macos runs-on: macos-12 - os: windows diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dd0b8b67..a0b748ec 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,15 +19,15 @@ jobs: include: - os: linux runs-on: ubuntu-22.04 - arch: 64bit + arch: x86-64 - - os: mac + - os: macos runs-on: macos-12 - arch: 64bit + arch: x86-64 - os: windows runs-on: windows-2022 - arch: 64bit + arch: x86-64 name: "${{ matrix.os }}-${{ matrix.arch }}" runs-on: ${{ matrix.runs-on }} diff --git a/scripts/fetch-configlet b/scripts/fetch-configlet index df2c0d90..4800e150 100755 --- a/scripts/fetch-configlet +++ b/scripts/fetch-configlet @@ -24,12 +24,12 @@ get_download_url() { local latest='https://api.github.com/repos/exercism/configlet/releases/latest' local arch case "$(uname -m)" in - *64*) arch='64bit' ;; - *686*) arch='32bit' ;; - *386*) arch='32bit' ;; - *) arch='64bit' ;; + x86_64) arch='x86-64' ;; + *686*) arch='i386' ;; + *386*) arch='i386' ;; + *) arch='x86-64' ;; esac - local suffix="${os}-${arch}.${ext}" + local suffix="${os}_${arch}.${ext}" curl "${curlopts[@]}" --header 'Accept: application/vnd.github.v3+json' "${latest}" | grep "\"browser_download_url\": \".*/download/.*/configlet.*${suffix}\"$" | cut -d'"' -f4 @@ -48,7 +48,7 @@ main() { local os case "$(uname)" in - Darwin*) os='mac' ;; + Darwin*) os='macos' ;; Linux*) os='linux' ;; Windows*) os='windows' ;; MINGW*) os='windows' ;; @@ -58,8 +58,8 @@ main() { local ext case "${os}" in - windows*) ext='zip' ;; - *) ext='tgz' ;; + windows*) ext='zip' ;; + *) ext='tar.gz' ;; esac echo "Fetching configlet..." >&2 diff --git a/scripts/fetch-configlet.ps1 b/scripts/fetch-configlet.ps1 index c7dd50e4..ab8f1036 100644 --- a/scripts/fetch-configlet.ps1 +++ b/scripts/fetch-configlet.ps1 @@ -12,8 +12,8 @@ $requestOpts = @{ RetryIntervalSec = 1 } -$arch = If ([Environment]::Is64BitOperatingSystem) { "64bit" } Else { "32bit" } -$fileName = "configlet-windows-$arch.zip" +$arch = If ([Environment]::Is64BitOperatingSystem) { "x86-64" } Else { "i386" } +$fileName = "configlet_.+_windows_$arch.zip" Function Get-DownloadUrl { $latestUrl = "https://api.github.com/repos/exercism/configlet/releases/latest"