Skip to content

Commit e05030d

Browse files
authored
Update CI (#18)
* naively try upgrading macos and all outdated actions * adjust compiler paths for arm64 * try upgrading to new setuptools version * allow releases with tags of the form v[version][suffix] for an arbitrary suffix
1 parent 0ebab8e commit e05030d

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

.github/workflows/ci.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
matrix:
15-
os: [ubuntu-latest, macos-12]
15+
os: [ubuntu-latest, macos-latest]
1616

1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1919
- name: Install dependencies on Linux
2020
run: |
2121
sudo apt-get install libopenblas-dev ninja-build ccache
@@ -26,7 +26,7 @@ jobs:
2626
brew install ninja ccache libomp cmake llvm
2727
brew install coreutils || true
2828
if: contains( matrix.os, 'macos')
29-
- uses: actions/cache@v1
29+
- uses: actions/cache@v4
3030
env:
3131
cache-name: cache-artifacts
3232
with:
@@ -48,7 +48,7 @@ jobs:
4848
shell: bash
4949
run: |
5050
ccache --max-size 2G
51-
CC=/usr/local/opt/llvm/bin/clang CXX=/usr/local/opt/llvm/bin/clang++ ./build_libtensor.py -v -d ${{runner.workspace}}/build --install ${{runner.workspace}}/install --type Release --features libxm
51+
CC=/opt/homebrew/opt/llvm/bin/clang CXX=/opt/homebrew/opt/llvm/bin/clang++ ./build_libtensor.py -v -d ${{runner.workspace}}/build --install ${{runner.workspace}}/install --type Release --features libxm
5252
5353
- name: Test
5454
working-directory: ${{runner.workspace}}/build
@@ -58,10 +58,11 @@ jobs:
5858
- name: Bundle tarball
5959
shell: bash
6060
run: |
61+
python -m pip install --user -U setuptools
6162
./scripts/pack_release.py ${{runner.workspace}}/install
6263
6364
- name: Upload tarball as artefact
64-
uses: actions/upload-artifact@v2
65+
uses: actions/upload-artifact@v4
6566
with:
6667
name: libtensorlight-${{ matrix.os }}
6768
path: libtensorlight-*.tar.gz
@@ -71,7 +72,7 @@ jobs:
7172
needs: build
7273
runs-on: ubuntu-latest
7374
steps:
74-
- uses: actions/download-artifact@v2
75+
- uses: actions/download-artifact@v4
7576
with:
7677
path: artifacts
7778
- name: Glob asset paths

scripts/pack_release.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,14 @@
2828
universal_newlines=True).strip()
2929
git_tag = subprocess.check_output(["git", "tag", "--points-at", git_revision],
3030
universal_newlines=True).strip()
31-
if not re.match("^v([0-9.]+)$", git_tag):
31+
if git_tag.startswith(f"v{ltl_version}"):
32+
# allow any tag of the form v[version][suffix] with an arbitrary suffix
33+
# However, the CI requires that there are no '-' in the suffix
34+
ltl_version = git_tag.replace('-', '_')
35+
else:
3236
ltl_version = ltl_version + ".dev"
3337

3438
filename = f"libtensorlight-{ltl_version}-{platform}.tar.gz"
35-
subprocess.check_call(["tar", "-C", install_dir, "-czf", filename, "include", "lib"])
39+
subprocess.check_call(
40+
["tar", "-C", install_dir, "-czf", filename, "include", "lib"]
41+
)

0 commit comments

Comments
 (0)