Skip to content

Commit 50242c8

Browse files
committed
index.js: migration from lunar to oracular
1 parent d3192ec commit 50242c8

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on:
2222

2323
jobs:
2424
debug1:
25-
runs-on: ubuntu-latest
25+
runs-on: ubuntu-24.04
2626
name: Check commands
2727
steps:
2828
- uses: actions/checkout@v4

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Example:
77
```yml
88
jobs:
99
example:
10-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-24.04
1111
name: Example
1212
steps:
1313
- uses: actions/checkout@v4

index.js

+21-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
// Running a script that sets everything up
22

33
const exec = require('@actions/exec');
4-
const core = require('@actions/core')
4+
const core = require('@actions/core');
5+
6+
function error(message) {
7+
core.setFailed(message);
8+
process.exit(1);
9+
}
510

611
async function installPkg(pkgname) {
712
let attempts = 0;
@@ -12,8 +17,7 @@ async function installPkg(pkgname) {
1217
break;
1318
} catch (error) {
1419
if (attempts > 3) {
15-
core.setFailed("Something went wrong :/");
16-
process.exit(1);
20+
error("Something went wrong :/");
1721
}
1822
attempts += 1;
1923
continue;
@@ -22,10 +26,22 @@ async function installPkg(pkgname) {
2226
}
2327

2428
async function start() {
29+
let myOutput = '';
30+
await exec.exec("grep", ["^DISTRIB_RELEASE=", "/etc/lsb-release"], {
31+
listeners: {
32+
stdout: (data) => {
33+
myOutput += data.toString();
34+
}
35+
}
36+
});
37+
if (myOutput.split("=").at(-1).split(".").at(0) != "24") {
38+
error("old version of ubuntu, must be version 24 of ubuntu");
39+
}
40+
2541
await installPkg("libarchive-tools");
2642

27-
await exec.exec("sudo su -c \"echo 'deb http://archive.ubuntu.com/ubuntu/ lunar universe' > /etc/apt/sources.list.d/lunar.list\"");
28-
await exec.exec("sudo su -c \"echo 'deb-src http://archive.ubuntu.com/ubuntu/ lunar universe' >> /etc/apt/sources.list.d/lunar.list\"");
43+
await exec.exec("sudo su -c \"echo 'deb http://archive.ubuntu.com/ubuntu/ oracular universe' > /etc/apt/sources.list.d/oracular.list\"");
44+
await exec.exec("sudo su -c \"echo 'deb-src http://archive.ubuntu.com/ubuntu/ oracular universe' >> /etc/apt/sources.list.d/oracular.list\"");
2945

3046
await installPkg("pacman-package-manager");
3147
}

0 commit comments

Comments
 (0)