Skip to content

Commit

Permalink
Merge pull request #77 from waja/fix_skopeo
Browse files Browse the repository at this point in the history
Adding installation of skopeo
  • Loading branch information
dawidd6 authored Jan 6, 2024
2 parents d33a5e2 + 627d37b commit c7f4c07
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -52,16 +53,23 @@ 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:
cpu_architecture: ${{matrix.arch}}
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}}*.*
Expand Down
16 changes: 16 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -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 {
Expand Down

0 comments on commit c7f4c07

Please sign in to comment.