Skip to content

Commit 3dcb38b

Browse files
author
3code
committed
fix CI: remove nimble setup, add upload-artifact, fix paths filter, release tag resolution
1 parent c971428 commit 3dcb38b

4 files changed

Lines changed: 30 additions & 28 deletions

File tree

‎.github/workflows/linux.yml‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ jobs:
3131
repo-token: ${{ secrets.GITHUB_TOKEN }}
3232

3333
- name: Install dependencies
34-
run: |
35-
nimble install -y --depsOnly
36-
nimble setup -y
37-
echo '--path:"src"' >> nimble.paths
34+
run: nimble install -y --depsOnly
3835

3936
- name: Compute build flags
4037
run: |
@@ -57,6 +54,12 @@ jobs:
5754
cp README.md LICENSE ${{ matrix.artifact }}/
5855
tar czf ${{ matrix.artifact }}.${{ matrix.ext }} ${{ matrix.artifact }}
5956
57+
- name: Upload artifact (GitHub Actions)
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: ${{ matrix.artifact }}
61+
path: ${{ matrix.artifact }}.${{ matrix.ext }}
62+
6063
- name: Upload artifact to 3code.capocasa.dev
6164
if: github.ref == 'refs/heads/main'
6265
run: |

‎.github/workflows/osx.yml‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ on:
44
push:
55
branches: [main]
66
tags: ['[0-9]+.[0-9]+.[0-9]+']
7-
paths:
8-
- '.github/workflows/osx.yml'
9-
- 'src/**'
10-
- 'tests/**'
11-
- '*.nimble'
12-
- 'config.nims'
137

148
jobs:
159
build:
@@ -23,10 +17,7 @@ jobs:
2317
repo-token: ${{ secrets.GITHUB_TOKEN }}
2418

2519
- name: Install dependencies
26-
run: |
27-
nimble install -y --depsOnly
28-
nimble setup -y
29-
echo '--path:"src"' >> nimble.paths
20+
run: nimble install -y --depsOnly
3021

3122
- name: Compute build flags
3223
shell: bash
@@ -69,6 +60,12 @@ jobs:
6960
curl -fsSL https://curl.se/ca/cacert.pem -o 3code-macos-universal/cacert.pem
7061
tar czf 3code-macos-universal.tar.gz 3code-macos-universal
7162
63+
- name: Upload artifact (GitHub Actions)
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: 3code-macos-universal
67+
path: 3code-macos-universal.tar.gz
68+
7269
- name: Upload artifact to 3code.capocasa.dev
7370
if: github.ref == 'refs/heads/main'
7471
run: |

‎.github/workflows/release.yml‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,14 @@ jobs:
2121
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2222
GH_REPO: ${{ github.repository }}
2323
run: |
24-
sha="${{ github.sha }}"
25-
tag="${{ github.ref_name }}"
24+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
25+
tag="${{ inputs.tag }}"
26+
sha=$(gh api "repos/${{ github.repository }}/commits/$tag" -q '.sha')
27+
else
28+
tag="${{ github.ref_name }}"
29+
sha="${{ github.sha }}"
30+
fi
31+
echo "tag=$tag sha=$sha"
2632
mkdir -p dl
2733
2834
for workflow in Linux OSX Windows; do
@@ -75,9 +81,14 @@ jobs:
7581
env:
7682
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7783
run: |
78-
gh release create "${{ github.ref_name }}" \
84+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
85+
tag="${{ inputs.tag }}"
86+
else
87+
tag="${{ github.ref_name }}"
88+
fi
89+
gh release create "$tag" \
7990
--repo ${{ github.repository }} \
80-
--title "${{ github.ref_name }}" \
91+
--title "$tag" \
8192
--generate-notes \
8293
3code-linux-amd64.tar.gz \
8394
3code-linux-arm64.tar.gz \

‎.github/workflows/windows.yml‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ on:
55
push:
66
branches: [main]
77
tags: ['[0-9]+.[0-9]+.[0-9]+']
8-
paths:
9-
- '.github/workflows/windows.yml'
10-
- 'src/**'
11-
- 'tests/**'
12-
- '*.nimble'
13-
- 'config.nims'
148

159
jobs:
1610
build:
@@ -34,10 +28,7 @@ jobs:
3428
repo-token: ${{ secrets.GITHUB_TOKEN }}
3529

3630
- name: Install dependencies
37-
run: |
38-
nimble install -y --depsOnly
39-
nimble setup -y
40-
echo '--path:"src"' >> nimble.paths
31+
run: nimble install -y --depsOnly
4132

4233
- name: Compute build flags
4334
run: |

0 commit comments

Comments
 (0)