Skip to content

Commit 3f3041d

Browse files
committed
Adjust workflow to produce debs for more debians/ubuntus.
Also update Rust to the latest version.
1 parent 431d6be commit 3f3041d

21 files changed

Lines changed: 120 additions & 206 deletions

.github/workflows/release-test.yml

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

.github/workflows/release.yml

Lines changed: 51 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,67 @@
11
name: Release
22

33
on:
4+
workflow_dispatch:
45
release:
56
types: [created]
67

78
jobs:
89
deb:
9-
name: Debian/Ubuntu (deb)
10+
name: Create deb packages
1011
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os:
16+
- ubuntu:25.04
17+
- ubuntu:24.10
18+
- ubuntu:24.04
19+
- ubuntu:22.04
20+
- debian:bullseye
21+
- debian:bookworm
22+
- debian:trixie
23+
container:
24+
image: ${{ matrix.os }}
1125
steps:
1226
- uses: actions/checkout@v4
27+
- name: Install Deps
28+
run: |
29+
apt update
30+
apt install -yy libseccomp-dev build-essential fpc
31+
- name: Install Rust
32+
uses: dtolnay/rust-toolchain@stable
33+
id: install-rust
34+
- name: Install cargo-deb
35+
run: cargo install cargo-deb
36+
37+
- name: Calculate artifact suffix
38+
shell: python3 {0}
39+
run: |
40+
import os
41+
artifact_suffix="${{ matrix.os }}".replace(':', '-')
42+
open(os.getenv("GITHUB_ENV"), "a").write(f"ARTIFACT_SUFFIX={artifact_suffix}\n")
43+
44+
- name: Release build
45+
run: cargo build --release
46+
47+
- name: Generate autocompletion files
48+
run: target/release/task-maker-tools gen-autocompletion
49+
1350
- name: Build deb file
51+
run: cargo deb
52+
53+
- name: Package release tarball
1454
run: |
15-
docker run --rm -v $(pwd):/source ghcr.io/edomora97/task-maker-rust-release-linux
16-
- name: Upload the artifacts
17-
uses: skx/github-action-publish-binaries@master
18-
env:
19-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
ROOT=`pwd`
56+
cd target/debian/
57+
tar -zcvf ${ROOT}/tmr-debs-${{ env.ARTIFACT_SUFFIX }}.tar.gz *task-maker-rust*.*
58+
59+
- name: Upload release tarball
60+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
2061
with:
21-
args: "target/debian/*.deb"
22-
## For now do not build the docker container for the server/worker: it requires some fixes because the workers
23-
## now spawn a single instance instead of as many as cores. Moreover, the server and worker commands changed.
24-
# - name: Publish docker container
25-
# run: |
26-
# echo ${DOCKER_PASSWORD} | docker login --username edomora97 --password-stdin
27-
# export TM_VERSION=$(grep version Cargo.toml | head -n 1 | cut -d'"' -f 2)
28-
# cd tools/docker
29-
# docker build --build-arg TM_VERSION=$TM_VERSION -t edomora97/task-maker-rust:latest -t edomora97/task-maker-rust:$TM_VERSION .
30-
# docker push edomora97/task-maker-rust:$TM_VERSION
31-
# docker push edomora97/task-maker-rust:latest
32-
# env:
33-
# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
62+
name: tmr-debs-${{ env.ARTIFACT_SUFFIX }}
63+
path: tmr-debs-${{ env.ARTIFACT_SUFFIX }}.tar.gz
64+
compression-level: 0
3465

3566
aur:
3667
name: AUR
@@ -41,21 +72,11 @@ jobs:
4172
working-directory: tools/aur/task-maker-rust
4273
run: ./gen.sh > ../../../PKGBUILD
4374
- name: Publish PKGBUILD
75+
if: ${{ github.event_name == 'release' }} # skip on manual runs.
4476
uses: KSXGitHub/github-actions-deploy-aur@v4.1.1
4577
with:
4678
pkgname: task-maker-rust
4779
pkgbuild: ./PKGBUILD
4880
commit_username: ${{ secrets.AUR_USERNAME }}
4981
commit_email: ${{ secrets.AUR_EMAIL }}
5082
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
51-
52-
ppa:
53-
name: Publish PPA
54-
runs-on: ubuntu-latest
55-
steps:
56-
- uses: actions/checkout@v4
57-
- name: Trigger PPA build
58-
env:
59-
GH_TOKEN: ${{ secrets.PAT_PPA_ACTION_TRIGGER }}
60-
run: |
61-
gh workflow run -R dp1/task-maker-rust-ppa --ref master check-for-release.yml

.github/workflows/rust.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,3 @@ jobs:
5858

5959
- name: cargo fmt
6060
run: cargo fmt --all -- --check
61-
62-
cargo-lock-3:
63-
name: Check cargo lock version = 3
64-
runs-on: ubuntu-latest
65-
steps:
66-
- uses: actions/checkout@v4
67-
- name: check
68-
run: grep "version = 3" Cargo.lock > /dev/null

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,16 @@ The new cmsMake!
77
[![asciicast](https://asciinema.org/a/301849.svg)](https://asciinema.org/a/301849)
88

99
## Installation
10-
For **Ubuntu** and **Debian** users you can find the `.deb` file in the [Releases](https://github.com/olimpiadi-informatica/task-maker-rust/releases) page.
11-
Install the package using `sudo dpkg -i the_file.deb` and it's dependencies (if you need to) with `sudo apt install -f`.
12-
There is a good chance that you have already all the dependencies already installed.
13-
14-
For **Ubuntu** it's also possible to install task-maker-rust using a PPA:
10+
For **Ubuntu** and **Debian** users, you can install this package as follows:
1511

1612
```bash
17-
sudo add-apt-repository ppa:dariop1/task-maker-rust
18-
sudo apt update
19-
sudo apt install task-maker-rust
13+
echo "deb [signed-by=/etc/apt/keyrings/task-maker-rust.asc] https://artifacts.lucaversari.it/olimpiadi-informatica/task-maker-rust/latest/deb/$(lsb_release -cs) /" | sudo tee /etc/apt/sources.list.d/task-maker-rust.list
14+
curl https://artifacts.lucaversari.it/signing-key.asc | sudo tee /etc/apt/keyrings/task-maker-rust.asc > /dev/null
15+
sudo apt update && sudo apt install task-maker-rust
2016
```
2117

18+
You can also find the `.deb` files in the [Releases](https://github.com/olimpiadi-informatica/task-maker-rust/releases) page.
19+
2220
For **ArchLinux** users you can find the packages in the AUR: [`task-maker-rust`](https://aur.archlinux.org/packages/task-maker-rust) (the stable release)
2321
and [`task-maker-rust-git`](https://aur.archlinux.org/packages/task-maker-rust-git) (the version based on `master`).
2422

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn get_version() -> String {
1818
if from_git.is_empty() {
1919
version
2020
} else {
21-
format!("{}\n\nRevision: {}", version, from_git)
21+
format!("{version}\n\nRevision: {from_git}")
2222
}
2323
}
2424
Err(_) => version,

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.75"
2+
channel = "1.88"
33
components = [ "rustfmt", "clippy" ]

src/copy_dag.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub fn render_dag(dag: &ExecutionDAG) -> String {
4949
for exec in &group.executions {
5050
for dep in exec.dependencies() {
5151
if !files.contains_key(&dep) {
52-
panic!("Nope: {:#?} does not contain {:?}", exec, dep);
52+
panic!("Nope: {exec:#?} does not contain {dep:?}");
5353
}
5454
let file = &files[&dep];
5555
edges.push((Node::File(file.clone()), Node::Execution(exec.clone())));

src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ pub trait NiceError<T, E> {
1818
fn print_error(error: Error) {
1919
debug!("{:?}", error);
2020
let mut fail: &dyn std::error::Error = error.as_ref();
21-
eprintln!("Error: {}", fail);
21+
eprintln!("Error: {fail}");
2222
while let Some(cause) = fail.source() {
23-
eprintln!("\nCaused by:\n {}", cause);
23+
eprintln!("\nCaused by:\n {cause}");
2424
fail = cause;
2525
}
2626
}

src/sandbox.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub fn main_sandbox() {
3232
.expect("Failed to print result");
3333
}
3434
Err(e) => {
35-
let err = format!("Error: {:?}", e);
35+
let err = format!("Error: {e:?}");
3636
serde_json::to_writer(stdout(), &RawSandboxResult::Error(err))
3737
.expect("Failed to print result");
3838
}

src/tools/add_solution_checks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ fn process_solution(
214214
)
215215
})
216216
{
217-
eprintln!("Error: {:?}", e);
217+
eprintln!("Error: {e:?}");
218218
} else {
219219
written = " (written!)";
220220
}

0 commit comments

Comments
 (0)