Skip to content

Commit 1d5fd7b

Browse files
WIP: try to create nightly release
1 parent 963468e commit 1d5fd7b

File tree

2 files changed

+90
-6
lines changed

2 files changed

+90
-6
lines changed

.github/workflows/update_nightly.yml

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,94 @@ name: Create the nightly release
22
on:
33
schedule:
44
# Take into account lut99's sleep schedule
5-
cron: 0 4 * * *
5+
- cron: 0 4 * * *
66

77
# Manual mechanism to bump the nightly in case of a issue with the one from last night
88
workflow_dispatch:
99
inputs:
1010
ref:
1111
default: main
12-
optional: true
12+
required: false
1313
type: string
1414

15+
# TODO: block concurrent execution
16+
1517
jobs:
16-
# TODO: Tag the last commit on main as nightly, but only if this is not the case already
18+
tag:
19+
name: "Add nightly tag"
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
with:
25+
ref: ${{ inputs.ref || 'main' }}
26+
fetch-tags: true
27+
- name: Check if there is anything to be done
28+
run: |
29+
[[ $(git rev-parse HEAD) != $(git rev-parse nightly) ]]
30+
- name: Tag the latest commit
31+
run: |
32+
git config user.name "Brane"
33+
git config user.email "[email protected]"
34+
git tag -a nightly
35+
git push --follow-tags
36+
37+
build:
38+
name: "Build & package"
39+
needs: tag
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
include:
44+
- runner: ubuntu-latest
45+
os: linux
46+
arch: x86_64
47+
- runner: macos-latest
48+
os: macos
49+
arch: aarch64
50+
# Don't support windows for now as that is complicated with the Makefile,
51+
# might add when there's an xtask for building on Windows.
52+
# - runner: windows-latest
53+
# os: windows
54+
# arch: x86_64
55+
- runner: ubuntu-24.04-arm
56+
os: linux
57+
arch: aarch64
58+
- runner: macos-13
59+
os: macos
60+
arch: x86_64
61+
62+
runs-on: ${{ matrix.runner }}
63+
steps:
64+
- name: Build
65+
run: |
66+
make all
67+
- name: Package
68+
run: |
69+
cargo run --release --package xtask package release
70+
- name: Upload
71+
uses: actions/upload-artifact@v4
72+
with:
73+
# TODO: add some unique identifier
74+
name: build-${{ matrix.os }}-${{ matrix.arch }}-nightly
75+
path: |
76+
target/package/release/*
77+
if-no-files-found: error
78+
retention-days: 1
79+
80+
release:
81+
name: "Release artifacts to GitHub"
82+
needs: build
83+
runs-on: ubuntu-latest
84+
steps:
85+
- name: Download artifacts
86+
uses: actions/download-artifact@v4
87+
# without further specification, downloads all artifacts from the run
88+
with:
89+
path: release
90+
- name: Release
91+
uses: softprops/action-gh-release@v2
92+
with:
93+
files: |
94+
release/*
95+
fail_on_unmatched_files: true

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,17 @@ ifeq ($(UNAME_S),Linux)
1313
BINARY_TARGETS += brane-let
1414
endif
1515

16+
ALL_TARGETS := $(BINARY_TARGETS)
17+
WORKSPACE_MEMBERS := $(sort $(CENTRAL_SERVICES) $(WORKER_SERVICES) $(SHARED_SERVICES))
18+
19+
ifeq ($(UNAME_S),Linux)
20+
ALL_TARGETS += $(WORKSPACE_MEMBERS)
21+
endif
22+
1623
DYNAMIC_LIBRARES := brane-cli-c
1724

1825
BUILD_DIR := target
1926

20-
WORKSPACE_MEMBERS := $(sort $(CENTRAL_SERVICES) $(WORKER_SERVICES) $(SHARED_SERVICES))
21-
2227
BUILDX_ARGS := build
2328
CARGO_BUILD_ARGS :=
2429

@@ -65,7 +70,7 @@ endif
6570

6671
# Universal targets
6772
.PHONY: all
68-
all: $(WORKSPACE_MEMBERS) $(BINARY_TARGETS)
73+
all: $(ALL_TARGETS)
6974

7075
.PHONY: binaries
7176
binaries: $(BINARY_TARGETS)

0 commit comments

Comments
 (0)