diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d29f95af..f28ecc66 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,26 +69,30 @@ jobs: if: startsWith(matrix.os, 'macOS-') run: | brew install pass + - + name: Install gopass + env: + GOPASS_VERSION: v1.15.5 + run: go install github.com/gopasspw/gopass@${{ env.GOPASS_VERSION }} - name: GPG conf - if: ${{ !startsWith(matrix.os, 'windows-') }} uses: actions/github-script@v7 id: gpg with: script: | const fs = require('fs'); - const gnupgfolder = `${require('os').homedir()}/.gnupg`; + const sep = require('path').sep; + const gnupgfolder = `${require('os').homedir()}${sep}.gnupg`; if (!fs.existsSync(gnupgfolder)){ fs.mkdirSync(gnupgfolder); } - fs.copyFile('.github/workflows/fixtures/gpg.conf', `${gnupgfolder}/gpg.conf`, (err) => { + fs.copyFile('.github/workflows/fixtures/gpg.conf', `${gnupgfolder}${sep}gpg.conf`, (err) => { if (err) throw err; }); core.setOutput('key', fs.readFileSync('.github/workflows/fixtures/7D851EB72D73BDA0.key', {encoding: 'utf8'})); core.setOutput('passphrase', fs.readFileSync('.github/workflows/fixtures/7D851EB72D73BDA0.pass', {encoding: 'utf8'})); - name: Import GPG key - if: ${{ !startsWith(matrix.os, 'windows-') }} uses: crazy-max/ghaction-import-gpg@v6 with: gpg_private_key: ${{ steps.gpg.outputs.key }} @@ -100,6 +104,18 @@ jobs: run: | pass init 7D851EB72D73BDA0 shell: bash + - + name: Init gopass + run: | + gopass config mounts.path "${HOME}/.gopass-password-store" 1>/dev/null + gopass config core.autopush false 1>/dev/null + gopass config core.autosync false 1>/dev/null + gopass config core.exportkeys false 1>/dev/null + gopass config core.notifications false 1>/dev/null + gopass config core.color false 1>/dev/null + gopass config core.nopager true 1>/dev/null + gopass init --crypto gpgcli --storage fs 7D851EB72D73BDA0 + shell: bash - name: Test run: | diff --git a/Dockerfile b/Dockerfile index 06cfe40f..e5a88802 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ ARG XX_VERSION=1.4.0 ARG OSXCROSS_VERSION=11.3-r7-debian ARG GOLANGCI_LINT_VERSION=v1.55.2 ARG DEBIAN_FRONTEND=noninteractive +ARG GOPASS_VERSION=v1.15.5 ARG PACKAGE=github.com/docker/docker-credential-helpers @@ -68,12 +69,19 @@ RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev p FROM base AS test ARG DEBIAN_FRONTEND +ARG GOPASS_VERSION RUN xx-apt-get install -y dbus-x11 gnome-keyring gpg-agent gpgconf libsecret-1-dev pass +RUN --mount=type=bind,target=. \ + --mount=type=cache,target=/root/.cache \ + --mount=type=cache,target=/go/pkg/mod \ + GOFLAGS='' go install github.com/gopasspw/gopass@${GOPASS_VERSION} RUN --mount=type=bind,target=. \ --mount=type=cache,target=/root/.cache \ --mount=type=cache,target=/go/pkg/mod </dev/null + gopass config core.autopush false 1>/dev/null + gopass config core.autosync false 1>/dev/null + gopass config core.exportkeys false 1>/dev/null + gopass config core.notifications false 1>/dev/null + gopass config core.color false 1>/dev/null + gopass config core.nopager true 1>/dev/null + gopass init --crypto gpgcli --storage fs 7D851EB72D73BDA0 + gpg -k mkdir /out @@ -106,7 +127,8 @@ RUN --mount=type=bind,target=. \ --mount=type=bind,source=/tmp/.revision,target=/tmp/.revision,from=version <