Skip to content
This repository was archived by the owner on Jan 11, 2026. It is now read-only.

Commit 8ebe7c1

Browse files
committed
fix(bugfix): Bugfix for nightly adding commit
Signed-off-by: dark0dave <dark0dave@mykolab.com>
1 parent 3eb11ba commit 8ebe7c1

5 files changed

Lines changed: 114 additions & 238 deletions

File tree

.github/workflows/doc.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: doc
22
on:
33
push:
4-
branches:
5-
- devel
64
concurrency:
75
group: ${{ github.ref }}-${{ github.workflow }}
86
cancel-in-progress: true
@@ -27,9 +25,8 @@ jobs:
2725
uses: actions/upload-pages-artifact@v3
2826
with:
2927
path: obj
30-
31-
# Deployment job
3228
deploy:
29+
if: startsWith(github.ref, 'refs/tags/') && startsWith(github.ref_name, 'nightly') != true
3330
environment:
3431
name: github-pages
3532
url: ${{ steps.deployment.outputs.page_url }}

.github/workflows/main.yaml

Lines changed: 51 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: main
22
on:
33
push:
4-
branches:
5-
- devel
6-
pull_request:
74
concurrency:
85
group: ${{ github.ref }}-${{ github.workflow }}
96
cancel-in-progress: true
@@ -100,23 +97,6 @@ jobs:
10097
name: ubuntu-latest
10198
path: WeiDU-Linux-*.zip
10299
if-no-files-found: error
103-
build-docker:
104-
runs-on: ubuntu-latest
105-
steps:
106-
- name: Checkout
107-
uses: actions/checkout@v4.2.2
108-
with:
109-
fetch-depth: 0
110-
submodules: true
111-
- name: Set up Docker Buildx
112-
uses: docker/setup-buildx-action@v3
113-
- name: Build and push Docker image
114-
uses: docker/build-push-action@v6
115-
with:
116-
context: .
117-
push: false
118-
cache-from: type=gha
119-
cache-to: type=gha
120100
build-windows:
121101
runs-on: windows-2022
122102
steps:
@@ -145,56 +125,62 @@ jobs:
145125
name: windows-latest
146126
path: WeiDU-Windows-*.zip
147127
if-no-files-found: error
148-
build-docs:
128+
build-docker:
129+
runs-on: ubuntu-latest
130+
steps:
131+
- name: Checkout
132+
uses: actions/checkout@v4.2.2
133+
with:
134+
fetch-depth: 0
135+
submodules: true
136+
- name: Set up Docker Buildx
137+
uses: docker/setup-buildx-action@v3
138+
- name: Build and push Docker image
139+
uses: docker/build-push-action@v6
140+
with:
141+
context: .
142+
push: false
143+
cache-from: type=gha
144+
cache-to: type=gha
145+
trigger-nightly-release:
146+
needs: [build-nix, build-macos, build-linux, build-windows,build-docker]
147+
if: github.ref == 'refs/heads/devel'
149148
runs-on: ubuntu-latest
150149
steps:
151150
- uses: actions/checkout@main
152-
- uses: cachix/install-nix-action@master
151+
- name: generate_version
152+
id: generate_version
153+
run: |
154+
major_version=$(grep 'version =' src/version.ml | cut -d'"' -f2 | cut -c-3)
155+
minor_version=$(grep 'version =' src/version.ml | cut -d'"' -f2 | cut -c4-)
156+
echo "version=${major_version}.${minor_version}" >> "$GITHUB_OUTPUT"
157+
- name: create tag
158+
uses: actions/github-script@v8
153159
with:
154-
nix_path: nixpkgs=channel:nixos-25.05
155-
- name: Build static files
156-
shell: 'nix develop -c bash -e {0}'
160+
script: |
161+
const short_sha = context.sha.substring(0, 7);
162+
github.rest.git.createRef({
163+
owner: context.repo.owner,
164+
repo: context.repo.repo,
165+
ref: `refs/tags/v${{ steps.generate_version.outputs.version }}-nightly-${short_sha}`,
166+
sha: context.sha,
167+
});
168+
- name: trigger
157169
run: |
158-
make -C doc
159-
release:
160-
name: release
161-
permissions:
162-
contents: write
163-
needs: [build-nix, build-macos, build-linux, build-windows]
170+
short_sha=$(git rev-parse --short ${{ github.sha }})
171+
ref=$(echo "v${{ steps.generate_version.outputs.version }}-nightly-${short_sha}")
172+
echo "${ref}"
173+
gh workflow run release.yaml --ref "${ref}" -f run_id=${{ github.run_id }}
174+
env:
175+
GH_TOKEN: ${{ github.token }}
176+
trigger-release:
177+
needs: [build-nix, build-macos, build-linux, build-windows,build-docker]
178+
if: startsWith(github.ref, 'refs/tags/')
164179
runs-on: ubuntu-latest
165-
if: github.event_name == 'push' && github.ref_name == 'devel'
166180
steps:
167181
- uses: actions/checkout@main
168-
- name: download linux artifact
169-
uses: actions/download-artifact@main
170-
with:
171-
name: ubuntu-latest
172-
path: linux
173-
- name: download mac artifact
174-
uses: actions/download-artifact@main
175-
with:
176-
name: macos-15-intel
177-
path: macos
178-
- name: download mac artifact
179-
uses: actions/download-artifact@main
180-
with:
181-
name: macos-latest
182-
path: macos-arm
183-
- name: download windows artifact
184-
uses: actions/download-artifact@main
185-
with:
186-
name: windows-latest
187-
path: windows
188-
- run: |
189-
mv linux/*.zip .
190-
mv macos/*.zip .
191-
mv macos-arm/WeiDU-Mac-250.zip WeiDU-Mac-ARM-250.zip
192-
mv windows/*.zip .
193-
- name: Create Release
194-
id: create_release
195-
uses: ncipollo/release-action@v1.20.0
196-
with:
197-
generateReleaseNotes: true
198-
artifacts: "*zip"
199-
prerelease: true
200-
name: nightly-${{ github.sha }}
182+
- name: trigger
183+
run: |
184+
gh workflow run release.yaml --ref ${{ github.ref_name }} -f run_id=${{ github.run_id }}
185+
env:
186+
GH_TOKEN: ${{ github.token }}

.github/workflows/release.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
run_id:
6+
required: true
7+
type: string
8+
concurrency:
9+
group: ${{ github.ref }}-${{ github.workflow }}
10+
cancel-in-progress: true
11+
jobs:
12+
release:
13+
permissions:
14+
contents: write
15+
actions: read
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@main
19+
- name: download linux artifact
20+
uses: actions/download-artifact@main
21+
with:
22+
run-id: ${{ inputs.run_id }}
23+
github-token: ${{ github.token }}
24+
name: ubuntu-latest
25+
path: linux
26+
- name: download mac artifact
27+
uses: actions/download-artifact@main
28+
with:
29+
run-id: ${{ inputs.run_id }}
30+
github-token: ${{ github.token }}
31+
name: macos-15-intel
32+
path: macos
33+
- name: download mac artifact
34+
uses: actions/download-artifact@main
35+
with:
36+
run-id: ${{ inputs.run_id }}
37+
github-token: ${{ github.token }}
38+
name: macos-latest
39+
path: macos-arm
40+
- name: download windows artifact
41+
uses: actions/download-artifact@main
42+
with:
43+
run-id: ${{ inputs.run_id }}
44+
github-token: ${{ github.token }}
45+
name: windows-latest
46+
path: windows
47+
- name: move zips
48+
run: |
49+
mv linux/*.zip .
50+
mv macos/*.zip .
51+
arm=$(ls macos-arm/WeiDU-Mac-*.zip)
52+
mv "${arm}" "${arm/WeiDU-Mac-/WeiDU-Mac-ARM-}"
53+
mv macos-arm/WeiDU-*.zip .
54+
mv windows/*.zip .
55+
- name: Create Release
56+
id: create_release
57+
uses: ncipollo/release-action@v1.20.0
58+
with:
59+
generateReleaseNotes: true
60+
artifacts: "*zip"
61+
prerelease: ${{ contains(github.ref_name, 'nightly') }}

.github/workflows/tag.yaml

Lines changed: 0 additions & 168 deletions
This file was deleted.

0 commit comments

Comments
 (0)