Skip to content

Update Examples action to run on Windows, MacOs, and Linux #974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,23 @@ concurrency:

jobs:
examples:
name: Build and run examples
runs-on: ubuntu-latest
name: Build and run examples on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

permissions:
id-token: write

steps:
- name: Enable long paths in Git
if: runner.os == 'Windows'
run: git config --system core.longpaths true
shell: bash

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
Expand All @@ -36,19 +46,22 @@ jobs:

- name: run examples against released sigstore
working-directory: examples/hello-world
shell: bash
run: ./test.sh

- name: install sigstore java development jars into mavenLocal
run: ./gradlew publishToMavenLocal -Prelease -PskipSigning

- name: calculate development version
id: dev_version
shell: bash
run: |
set -Exeo pipefail
echo "version=$(grep "^version=" gradle.properties | cut -d'=' -f2)" >> $GITHUB_OUTPUT

- name: run examples against development version
working-directory: examples/hello-world
shell: bash
env:
VERSION: ${{ steps.dev_version.outputs.version }}
run: ./test.sh -Dsigstore.version=${VERSION}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static String toPemString(Certificate cert) throws IOException {
pemWriter.writeObject(cert);
pemWriter.flush();
}
return certWriter.toString();
return certWriter.toString().replaceAll("\r\n", "\n");
}

/** Convert a certificate to a PEM encoded certificate. */
Expand Down Expand Up @@ -94,7 +94,7 @@ public static String toPemString(CertPath certs) throws IOException {
}
pemWriter.flush();
}
return certWriter.toString();
return certWriter.toString().replaceAll("\r\n", "\n");
}

/** Convert a CertPath to a PEM encoded certificate chain. */
Expand Down
Loading