Skip to content

Commit

Permalink
Change to other workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
giarc3 committed Oct 26, 2023
1 parent 3a76219 commit 3b6f1ce
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 67 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/release-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,23 @@ jobs:
if: github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release-')
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/setup-java@v1
- uses: actions/checkout@v4
- uses: IronCoreLabs/rust-toolchain@v1
- uses: actions/setup-java@v3
with:
java-version: 8
distribution: adopt
- run: sudo apt-get install -y clang
- name: Install cross
run: cargo install cross
- name: Run build script
run: ./build-aar.sh
working-directory: android
- name: Decrypt PGP key
uses: IronCoreLabs/ironhide-actions/decrypt@v1
with:
keys: ${{ secrets.IRONHIDE_KEYS }}
input: .github/signing-key.asc.iron
- name: Decrypt nexus credentials
uses: IronCoreLabs/ironhide-actions/decrypt@v1
uses: IronCoreLabs/ironhide-actions/decrypt@v3
with:
keys: ${{ secrets.IRONHIDE_KEYS }}
input: .github/auth.properties.iron
input: .github/signing-key.asc.iron .github/auth.properties.iron
- name: Import PGP key
run: gpg --batch --import .github/signing-key.asc
- name: Export PGP signing key
Expand Down
68 changes: 31 additions & 37 deletions .github/workflows/release-github.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ jobs:
- build-java
- build-cpp
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# base_ref will typically be main. We'll need to commit a change to that branch and push it.
ref: ${{ github.base_ref }}
# If we use the default GITHUB_TOKEN then CI won't run after we push our changes. This WORKFLOW_PAT is a personal
# access token with "repo" permissions.
token: ${{ secrets.WORKFLOW_PAT }}
- name: Decrypt PGP key
uses: IronCoreLabs/ironhide-actions/decrypt@v1
uses: IronCoreLabs/ironhide-actions/decrypt@v3
with:
keys: ${{ secrets.IRONHIDE_KEYS }}
input: .github/signing-key.asc.iron
Expand Down Expand Up @@ -54,14 +54,13 @@ jobs:
with:
tag_name: ${{ steps.version.outputs.tag }}
release_name: Version ${{ steps.version.outputs.tag }}

- name: Download java release artifacts from ubuntu-22.04
uses: actions/download-artifact@v1
uses: actions/download-artifact@v3
with:
name: release-ubuntu-22.04
path: release/ubuntu-22.04
- name: Delete artifact
uses: geekyeggo/delete-artifact@v1
uses: geekyeggo/delete-artifact@v2
with:
name: release-ubuntu-22.04
failOnError: false
Expand All @@ -74,34 +73,34 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Download java release artifacts from macos-11
uses: actions/download-artifact@v1
- name: Download java release artifacts from macos-12
uses: actions/download-artifact@v3
with:
name: release-macos-11
path: release/macos-11
name: release-macos-12
path: release/macos-12
- name: Delete artifact
uses: geekyeggo/delete-artifact@v1
uses: geekyeggo/delete-artifact@v2
with:
name: release-macos-11
name: release-macos-12
failOnError: false
- name: Sign java artifact for macos-11
- name: Sign java artifact for macos-12
run: |
gpg --batch --detach-sign -a release/macos-11/libironoxide_java.dylib
gpg --batch --verify release/macos-11/libironoxide_java.dylib.asc release/macos-11/libironoxide_java.dylib
- name: Upload java lib for macos-11
run: gh release upload ${{ steps.version.outputs.tag }} release/macos-11/libironoxide_java.dylib release/macos-11/libironoxide_java.dylib.asc --clobber
gpg --batch --detach-sign -a release/macos-12/libironoxide_java.dylib
gpg --batch --verify release/macos-12/libironoxide_java.dylib.asc release/macos-12/libironoxide_java.dylib
- name: Upload java lib for macos-12
run: gh release upload ${{ steps.version.outputs.tag }} release/macos-12/libironoxide_java.dylib release/macos-12/libironoxide_java.dylib.asc --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Download iOS release artifacts from build-cpp
uses: actions/download-artifact@v1
uses: actions/download-artifact@v3
with:
name: release-iOS
path: release/release-iOS
- name: Delete artifact
uses: geekyeggo/delete-artifact@v1
with:
name: release-macos-11
name: release-macos-12
failOnError: false
- name: Sign iOS artifact
run: |
Expand All @@ -123,46 +122,41 @@ jobs:
if: github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release-')
strategy:
matrix:
os: [ubuntu-22.04, macos-11]
os: [ubuntu-22.04, macos-12]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: olafurpg/setup-scala@v10
- uses: actions/checkout@v4
- uses: olafurpg/setup-scala@v14
with:
java-version: 11
# Not installing llvm for Mac because https://stackoverflow.com/a/35753922/107357
- name: Install llvm (ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get update && sudo apt-get install -y llvm
# Not installing llvm for Mac because https://stackoverflow.com/a/35753922/107357
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: IronCoreLabs/rust-toolchain@v1
- uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Upload artifacts for ubuntu-22.04
if: startsWith(matrix.os, 'ubuntu')
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: release-ubuntu-22.04
path: target/release/libironoxide_java.so
- name: Upload artifacts for macos-11
- name: Upload artifacts for macos-12
if: startsWith(matrix.os, 'macos')
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: release-macos-11
name: release-macos-12
path: target/release/libironoxide_java.dylib

build-cpp:
if: github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release-')
runs-on: macos-11
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/checkout@v4
- uses: IronCoreLabs/rust-toolchain@v1
- name: Setup iOS build
run: |
rustup target add x86_64-apple-ios aarch64-apple-ios
Expand All @@ -177,7 +171,7 @@ jobs:
tar -r -f ironoxide-homebrew.tar -C target/universal/release libironoxide.a
gzip ironoxide-homebrew.tar
- name: Upload iOS artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: release-iOS
path: ironoxide-homebrew.tar.gz
Expand All @@ -189,7 +183,7 @@ jobs:
needs:
- release
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# If we use the default GITHUB_TOKEN, it won't run our CI job once we create a PR. The WORKFLOW_PAT is a personal
# access token with "repo" permissions.
Expand Down
20 changes: 7 additions & 13 deletions .github/workflows/release-java.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,23 @@ jobs:
if: github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release-')
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Decrypt PGP key
uses: IronCoreLabs/ironhide-actions/decrypt@v1
- uses: actions/checkout@v4
- name: Decrypt keys
uses: IronCoreLabs/ironhide-actions/decrypt@v3
with:
keys: ${{ secrets.IRONHIDE_KEYS }}
input: .github/signing-key.asc.iron
input: .github/signing-key.asc.iron .github/sonatype.sbt.iron
- name: Import PGP key
run: gpg --batch --import .github/signing-key.asc
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/setup-java@v1
- uses: IronCoreLabs/rust-toolchain@v1
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: adopt
- name: Install llvm (ubuntu)
run: sudo apt-get update && sudo apt-get install -y llvm
- name: Cargo build
run: cargo build -p ironoxide-java
- name: Decrypt sonatype auth
uses: IronCoreLabs/ironhide-actions/decrypt@v1
with:
keys: ${{ secrets.IRONHIDE_KEYS }}
input: .github/sonatype.sbt.iron
- name: Install sonatype auth
run: |
mkdir -p ~/.sbt/1.0
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/start-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
if: github.event.ref_type == 'branch' && startsWith(github.event.ref, 'release-')
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# If we use the default GITHUB_TOKEN, it won't run our CI job once we create a PR. The WORKFLOW_PAT is a personal
# access token with "repo" permissions.
Expand All @@ -25,9 +25,7 @@ jobs:
run: |
git config --local user.email ops@ironcorelabs.com
git config --local user.name "Leeroy Travis"
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: IronCoreLabs/rust-toolchain@v1
- name: Calculate versions from github.ref
id: version
run: |
Expand Down
2 changes: 1 addition & 1 deletion java/tests/src/test/scala/ironoxide/DocumentTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ class DocumentTests extends TestSuite {
"roundtrip bytes" in {
val bytes = Array(2, 3).map(_.toByte)
val encryptResult = Try(primarySdk.documentEncrypt(bytes, new DocumentEncryptOpts)).toEither.value
val currentTime = java.lang.System.currentTimeMillis
encryptResult.getName.isEmpty shouldBe true
encryptResult.getErrors.getUsers.isEmpty shouldBe true
encryptResult.getErrors.getGroups.isEmpty shouldBe true
encryptResult.getChanged.getUsers.length shouldBe 1
val createdTime = encryptResult.getCreated().toInstant().toEpochMilli
val updatedTime = encryptResult.getLastUpdated().toInstant().toEpochMilli
val currentTime = java.lang.System.currentTimeMillis
(currentTime - createdTime) should be < 20000L // sanity check the document was created in the last 20 seconds
(currentTime - updatedTime) should be < 20000L // sanity check the document was last updated in the last 20 seconds

Expand Down

0 comments on commit 3b6f1ce

Please sign in to comment.