Skip to content

Commit c1428f9

Browse files
dudoslavihnorton
andauthored
Include r-tools build in release artifacts (#5415)
This PR adds rtools binaries into release artifacts. In order to upload/download artifacts and merge them into a single folder we had to upgrade upload/download-artifact to version 4. The CI/CD for release looks like this: https://github.com/dudoslav/TileDB/releases/tag/t45 --- TYPE: NO_HISTORY DESC: RTools release binaries --------- Co-authored-by: Isaiah Norton <[email protected]>
1 parent 66c50c0 commit c1428f9

File tree

3 files changed

+49
-16
lines changed

3 files changed

+49
-16
lines changed

.github/workflows/append-release-cmake.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,40 +33,53 @@ jobs:
3333
with:
3434
# repository: 'TileDB-Inc/TileDB'
3535
version: ${{ inputs.ref }}
36-
asset-file: '*.zip,*.tar.gz'
36+
asset-file: '*.zip,*.tar.gz,*.tar.xz'
3737
asset-output: './release/'
3838

3939
- name: Render template
4040
run: |
41-
PATTERN="tiledb-([^-]+)-([^-]+)(-noavx2)?-(.+)\.(tar\.gz|zip)$"
41+
PATTERN="tiledb-([^-]+)-([^-]+)(-noavx2|-mingw64_ucrt64)?-(.+)\.(tar\.gz|tar\.xz|zip)$"
4242
RELLIST="output/releases.csv"
4343
MODULE="output/DownloadPrebuiltTileDB.cmake"
4444
cp cmake/inputs/DownloadPrebuiltTileDB.cmake $MODULE
45-
echo "platform,url,sha256" > $RELLIST
45+
echo "platform,url,sha256,description" > $RELLIST
46+
47+
DESCRIPTION_LINUX_X86_64="Linux x86_64 release artifact"
48+
DESCRIPTION_LINUX_X86_64_NOAVX2="Linux x86_64 release artifact without AVX2 instructions"
49+
DESCRIPTION_LINUX_ARM64="Linux ARM64(aarch64) release artifact"
50+
DESCRIPTION_MACOS_ARM64="MacOS ARM64 release artifact"
51+
DESCRIPTION_MACOS_X86_64="MacOS x86_64 release artifact"
52+
DESCRIPTION_WINDOWS_X86_64="Windows x86_64 release artifact"
53+
DESCRIPTION_WINDOWS_X86_64_MINGW64_UCRT64="INTERNAL USE: Windows x86_64 release artifact produced in R toolchain"
4654
4755
for FILE in $(ls release)
4856
do
4957
if [[ $FILE =~ $PATTERN ]]
5058
then
5159
OS=${BASH_REMATCH[1]^^}
5260
ARCH=${BASH_REMATCH[2]^^}
53-
NOAVX2=${BASH_REMATCH[3]^^}
54-
PLATFORM=${OS}-${ARCH}${NOAVX2}
61+
OPTION=${BASH_REMATCH[3]^^}
62+
PLATFORM=${OS}-${ARCH}${OPTION}
63+
64+
if [[ $PLATFORM == *"SOURCE"* ]]; then
65+
continue
66+
fi
5567
5668
URL="${{ github.server_url }}/${{ github.repository }}/releases/download/${{ inputs.ref }}/$FILE"
57-
HASH=$(cat release/$FILE.sha256 | cut -d \t -f 1)
69+
HASH=$(cat release/$FILE.sha256 | cut -d ' ' -f 1)
5870
59-
echo "${PLATFORM},${URL},${HASH}" >> $RELLIST
71+
DESCRIPTION_VAR="DESCRIPTION_${PLATFORM//-/_}"
72+
echo "${PLATFORM},${URL},${HASH},${!DESCRIPTION_VAR}" >> $RELLIST
6073
fi
6174
done
6275
6376
SOURCE_FILE_NAME=$(ls release/tiledb-source-*.tar.gz)
6477
URL_TILEDB_SOURCE="${{ github.server_url }}/${{ github.repository }}/releases/download/${{ inputs.ref }}/$(basename $SOURCE_FILE_NAME)"
65-
HASH_TILEDB_SOURCE=$(cat $SOURCE_FILE_NAME.sha256 | cut -d \t -f 1)
78+
HASH_TILEDB_SOURCE=$(cat $SOURCE_FILE_NAME.sha256 | cut -d ' ' -f 1)
6679
67-
echo "source,${URL_TILEDB_SOURCE},${HASH_TILEDB_SOURCE}" >> $RELLIST
80+
echo "source,${URL_TILEDB_SOURCE},${HASH_TILEDB_SOURCE},Source release artifact" >> $RELLIST
6881
69-
HASH=$(sha256sum $RELLIST | cut -d " " -f 1)
82+
HASH=$(sha256sum $RELLIST | cut -d ' ' -f 1)
7083
echo $HASH > $RELLIST.sha256
7184
7285
cat $RELLIST

.github/workflows/build-rtools40.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,23 @@ jobs:
5555
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
5656
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
5757
shell: c:\rtools40\usr\bin\bash.exe --login {0}
58+
- name: Set variables
59+
shell: bash
60+
id: get-values
61+
run: |
62+
release_hash=$( echo ${{ github.sha }} | cut -c-7 - )
63+
ref=${{ github.head_ref || github.ref_name }}
64+
echo "release_version=${ref##*/}-$release_hash" >> $GITHUB_OUTPUT
65+
- name: "Rename release artifact and create sha256 hash"
66+
run: |
67+
mkdir release
68+
mv .github/workflows/mingw-w64-tiledb/*.pkg.tar.xz release/tiledb-windows-x86_64-mingw64_ucrt64-${{ steps.get-values.outputs.release_version }}.tar.xz
69+
sha256sum release/tiledb-windows-x86_64-mingw64_ucrt64-${{ steps.get-values.outputs.release_version }}.tar.xz > release/tiledb-windows-x86_64-mingw64_ucrt64-${{ steps.get-values.outputs.release_version }}.tar.xz.sha256
5870
- name: "Upload binaries"
5971
uses: actions/upload-artifact@v4
6072
with:
61-
name: mingw-w64-${{ matrix.msystem }}-tiledb
62-
path: .github/workflows/mingw-w64-tiledb/*.pkg.tar.*
73+
name: release-windows-x86_64-mingw64_ucrt64-${{ steps.get-values.outputs.release_version }}
74+
path: release/tiledb-*
6375
- name: "Print log files (failed build only)"
6476
shell: bash
6577
run: |

.github/workflows/release.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ jobs:
3434
- name: Upload Release Artifacts
3535
uses: actions/upload-artifact@v4
3636
with:
37-
name: release
37+
name: release-source
3838
path: |
39-
build/tiledb-*.tar.gz*
39+
build/tiledb-*
4040
4141
Package-Binary-Release:
4242
name: Package Binary Release - ${{ matrix.platform }}
@@ -136,6 +136,9 @@ jobs:
136136
source $GITHUB_WORKSPACE/scripts/ci/print_logs.sh
137137
if: failure() # only run this job if the build step failed
138138

139+
Build-R-Binaries:
140+
uses: ./.github/workflows/build-rtools40.yml
141+
139142
Test-Release-Artifacts:
140143
needs:
141144
- Package-Binary-Release
@@ -144,7 +147,7 @@ jobs:
144147
- name: Download release artifacts
145148
uses: actions/download-artifact@v4
146149
with:
147-
pattern: release-*
150+
pattern: "*"
148151
merge-multiple: true
149152
path: dist
150153
- name: Test names of release artifacts
@@ -158,6 +161,7 @@ jobs:
158161
needs:
159162
- Test-Release-Artifacts
160163
- Package-Source-Release
164+
- Build-R-Binaries
161165
if: startsWith(github.ref, 'refs/tags/')
162166
runs-on: ubuntu-latest
163167
steps:
@@ -167,6 +171,9 @@ jobs:
167171
pattern: release-*
168172
merge-multiple: true
169173
path: dist
174+
- name: DEBUG
175+
run: |
176+
ls -R dist/
170177
- name: Publish release artifacts
171178
uses: actions/github-script@v6
172179
with:
@@ -179,8 +186,9 @@ jobs:
179186
repo: repo.repo,
180187
tag: "${{ github.ref_name }}"
181188
});
182-
const globber = await glob.create('dist/*');
189+
const globber = await glob.create('dist/**/*');
183190
for await (const file of globber.globGenerator()) {
191+
console.log(`Uploading file: ${file}`);
184192
await github.rest.repos.uploadReleaseAsset({
185193
owner: repo.owner,
186194
repo: repo.repo,

0 commit comments

Comments
 (0)