Skip to content

Commit c58a351

Browse files
authored
Update Examples action to run on Windows, MacOs, and Linux (#974)
Fix windows formatting on PEM encoded certs and add windows tests --------- Signed-off-by: keastrid <70925169+keastrid@users.noreply.github.com>
1 parent 964d134 commit c58a351

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

.github/workflows/examples.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,23 @@ concurrency:
1414

1515
jobs:
1616
examples:
17-
name: Build and run examples
18-
runs-on: ubuntu-latest
17+
name: Build and run examples on ${{ matrix.os }}
18+
runs-on: ${{ matrix.os }}
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os: [ubuntu-latest, macos-latest, windows-latest]
1924

2025
permissions:
2126
id-token: write
2227

2328
steps:
29+
- name: Enable long paths in Git
30+
if: runner.os == 'Windows'
31+
run: git config --system core.longpaths true
32+
shell: bash
33+
2434
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2535
with:
2636
persist-credentials: false
@@ -36,19 +46,22 @@ jobs:
3646

3747
- name: run examples against released sigstore
3848
working-directory: examples/hello-world
49+
shell: bash
3950
run: ./test.sh
4051

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

4455
- name: calculate development version
4556
id: dev_version
57+
shell: bash
4658
run: |
4759
set -Exeo pipefail
4860
echo "version=$(grep "^version=" gradle.properties | cut -d'=' -f2)" >> $GITHUB_OUTPUT
4961
5062
- name: run examples against development version
5163
working-directory: examples/hello-world
64+
shell: bash
5265
env:
5366
VERSION: ${{ steps.dev_version.outputs.version }}
5467
run: ./test.sh -Dsigstore.version=${VERSION}

sigstore-java/src/main/java/dev/sigstore/encryption/certificates/Certificates.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static String toPemString(Certificate cert) throws IOException {
4848
pemWriter.writeObject(cert);
4949
pemWriter.flush();
5050
}
51-
return certWriter.toString();
51+
return certWriter.toString().replaceAll("\r\n", "\n");
5252
}
5353

5454
/** Convert a certificate to a PEM encoded certificate. */
@@ -94,7 +94,7 @@ public static String toPemString(CertPath certs) throws IOException {
9494
}
9595
pemWriter.flush();
9696
}
97-
return certWriter.toString();
97+
return certWriter.toString().replaceAll("\r\n", "\n");
9898
}
9999

100100
/** Convert a CertPath to a PEM encoded certificate chain. */

0 commit comments

Comments
 (0)