Merge pull request #77 from waja/fix_skopeo

Adding installation of skopeo
This commit is contained in:
Dawid Dziurla 2024-01-06 13:58:39 +01:00 committed by GitHub
commit c7f4c07ff6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 1 deletions

View file

@ -39,6 +39,7 @@ jobs:
repo: https://github.com/dawidd6/deber.git
ref: v1.0.0
lintian_opts: "-v"
install_skopeo: true
- package: netcat-openbsd
arch: arm64
repo: https://git.launchpad.net/ubuntu/+source/netcat-openbsd
@ -52,8 +53,14 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Clone repo
run: git clone --depth=1 ${{matrix.repo}} -b ${{matrix.ref}} ${{matrix.package}}
- name: Remove skopeo (for testing installation)
if: ${{matrix.install_skopeo}}
run: sudo apt-get remove -y skopeo
- name: Test run
uses: ./
with:
@ -61,7 +68,8 @@ jobs:
source_directory: ${{matrix.package}}
artifacts_directory: artifacts
lintian_opts: ${{matrix.lintian_opts}}
lintian_run: ${{matrix.lintian_run || false }}
lintian_run: ${{matrix.lintian_run || false}}
- name: Check files
run: |
ls -lh artifacts/${{matrix.package}}*.*

16
main.js
View file

@ -1,5 +1,6 @@
const core = require("@actions/core")
const exec = require("@actions/exec")
const io = require('@actions/io')
const firstline = require("firstline")
const path = require("path")
const fs = require("fs")
@ -16,6 +17,21 @@ function getImageTag(imageName, distribution) {
}
async function getImageName(distribution) {
const skopeoPath = await io.which('skopeo', false)
if (!skopeoPath) {
core.startGroup("Install skopeo")
await exec.exec("sudo", [
"apt-get",
"update"
])
await exec.exec("sudo", [
"apt-get",
"-y",
"install",
"skopeo"
])
core.endGroup()
}
const tag = getImageTag("", distribution)
for (const image of ["debian", "ubuntu"]) {
try {