Skip to content
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

Migrate to GitHub Actions. #512

Merged
merged 3 commits into from
Aug 21, 2023
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
73 changes: 0 additions & 73 deletions .circleci/config.yml

This file was deleted.

100 changes: 100 additions & 0 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: "Test and Deploy"

on:
push:
branches:
- master
- soroban
pull_request:
release:
types:
- created

env:
JAVA_VERSION: '11'
JAVA_DISTRIBUTION: 'microsoft'

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Test
run: ./gradlew check

shadow_jar:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Build JAR
run: ./gradlew shadowJar
- name: Persist JAR Artifact
uses: actions/upload-artifact@v3
with:
name: jar
path: build/libs/stellar-sdk.jar

javadoc:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Generate Documentation
run: ./gradlew javadoc
- name: Persist Documentation
uses: actions/upload-artifact@v3
with:
name: javadoc
path: javadoc

deploy:
needs: [ shadow_jar, javadoc ]
permissions:
contents: write
if: github.event_name == 'release' && github.event.action == 'created'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download JAR Artifact
uses: actions/download-artifact@v2
with:
name: jar
path: jar
- name: Download Java Documentation
uses: actions/download-artifact@v2
with:
name: javadoc
path: javadoc
- name: Archive Documentation
run: tar -czf stellar-sdk-javadoc.tar.gz javadoc
- name: Upload artifacts to GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
jar/stellar-sdk.jar
stellar-sdk-javadoc.tar.gz
- name: Upload Documentation to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: javadoc

16 changes: 0 additions & 16 deletions after_deploy.sh

This file was deleted.

12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,16 @@ tasks.register('updateGitHook', Copy) {
rename { fileName ->
fileName.endsWith('.sh') ? fileName[0..-4] : fileName
}
}

tasks.javadoc {
destinationDir = file('javadoc')
failOnError = true
exclude("org/stellar/sdk/xdr/**")
// cast options to StandardJavadocDocletOptions
// https://docs.gradle.org/current/javadoc/org/gradle/external/javadoc/StandardJavadocDocletOptions.html
StandardJavadocDocletOptions options = options as StandardJavadocDocletOptions
options.setSplitIndex(true)
options.setMemberLevel(JavadocMemberLevel.PUBLIC)
options.setEncoding('UTF-8')
}
4 changes: 2 additions & 2 deletions src/main/java/org/stellar/sdk/KeyPair.java
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ public DecoratedSignature signDecorated(byte[] data) {
/**
* Sign the provided payload data for payload signer where the input is the data being signed. Per
* the <a
* href="https://github.com/stellar/stellar-protocol/blob/master/core/cap-0040.md#signature-hint"
* CAP-40 Signature spec</a> {@link DecoratedSignature}.
* href="https://github.com/stellar/stellar-protocol/blob/master/core/cap-0040.md#signature-hint">CAP-40
* Signature spec</a> {@link DecoratedSignature}.
*
* @param signerPayload the payload signers raw data to sign
* @return DecoratedSignature
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/stellar/sdk/LedgerBounds.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@lombok.Builder
/**
* LedgerBounds are Preconditions of a transaction per <a
* href="https://github.com/stellar/stellar-protocol/blob/master/core/cap-0021.md#specification">CAP-21<a/>
* href="https://github.com/stellar/stellar-protocol/blob/master/core/cap-0021.md#specification">CAP-21</a>
*/
public class LedgerBounds {
long minLedger;
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/org/stellar/sdk/SignedPayloadSigner.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

/**
* Data model for the <a
* href="https://github.com/stellar/stellar-protocol/blob/master/core/cap-0040.md#xdr-changes">signed
* payload signer </a>
* href="https://github.com/stellar/stellar-protocol/blob/master/core/cap-0040.md#xdr-changes"
* target="_blank">signed payload signer</a>
*/
public class SignedPayloadSigner {
public static final int SIGNED_PAYLOAD_MAX_PAYLOAD_LENGTH = 64;
Expand Down Expand Up @@ -72,7 +72,8 @@ public AccountID getSignerAccountId() {
* get the payload that signatures are produced from.
*
* @see <a
* href="https://github.com/stellar/stellar-protocol/blob/master/core/cap-0040.md#semantics"/>
* href="https://github.com/stellar/stellar-protocol/blob/master/core/cap-0040.md#semantics">CAP-0040
* Semantics</a>
* @return
*/
public byte[] getPayload() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/stellar/sdk/SorobanServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public SimulateTransactionResponse simulateTransaction(Transaction transaction)
* Submit a trial contract invocation, first run a simulation of the contract invocation as
* defined on the incoming transaction, and apply the results to a new copy of the transaction
* which is then returned. Setting the ledger footprint and authorization, so the resulting
* transaction is ready for signing & sending.
* transaction is ready for signing and sending.
*
* <p>The returned transaction will also have an updated fee that is the sum of fee set on
* incoming transaction with the contract resource fees estimated from simulation. It is advisable
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/stellar/sdk/TransactionBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public TransactionBuilder addOperations(Collection<Operation> operations) {

/**
* Adds preconditions. For details of all preconditions on transaction refer to <a
* href="https://github.com/stellar/stellar-protocol/blob/master/core/cap-0021.md#specification">CAP-21<a/>
* href="https://github.com/stellar/stellar-protocol/blob/master/core/cap-0021.md#specification">CAP-21</a>
*
* @param preconditions the tx PreConditions
* @return updated Builder object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@Builder(toBuilder = true)
/**
* Preconditions of a transaction per <a
* href="https://github.com/stellar/stellar-protocol/blob/master/core/cap-0021.md#specification">CAP-21<a/>
* href="https://github.com/stellar/stellar-protocol/blob/master/core/cap-0021.md#specification">CAP-21</a>
*/
public class TransactionPreconditions {
public static final long MAX_EXTRA_SIGNERS_COUNT = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public AccountsRequestBuilder forAsset(AssetTypeCreditAlphaNum asset) {
/**
* Returns all accounts who have trustlines to the specified liquidity pool.
*
* @param Liquidity Pool ID
* @param liquidityPoolID Liquidity Pool ID
* @return current {@link AccountsRequestBuilder} instance
* @see <a href="https://developers.stellar.org/api/resources/accounts/list/">Accounts</a>
*/
Expand All @@ -107,7 +107,7 @@ public AccountsRequestBuilder forLiquidityPool(LiquidityPoolID liquidityPoolID)
/**
* Returns all accounts who have trustlines to the specified liquidity pool.
*
* @param Liquidity Pool ID
* @param liquidityPoolID Liquidity Pool ID
* @return current {@link AccountsRequestBuilder} instance
* @see <a href="https://developers.stellar.org/api/resources/accounts/list/">Accounts</a>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Throws when Soroban-RPC instance responds with error.
*
* @see <a href="https://www.jsonrpc.org/specification#error_object" target="_blank">JSON-RPC 2.0
* Specification - Error object<a>
* Specification - Error object</a>
*/
@Getter
public class SorobanRpcErrorResponse extends Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Represent the request sent to Soroban-RPC.
*
* @see <a href="https://www.jsonrpc.org/specification#request_object" target="_blank">JSON-RPC 2.0
* Specification - Request object<a>
* Specification - Request object</a>
*/
@RequiredArgsConstructor
@Value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public Links getLinks() {

/**
* Preconditions of a transaction per <a
* href="https://github.com/stellar/stellar-protocol/blob/master/core/cap-0021.md#specification">CAP-21<a/>
* href="https://github.com/stellar/stellar-protocol/blob/master/core/cap-0021.md#specification">CAP-21</a>
*/
@Value
public static class Preconditions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Represent the response returned by Soroban-RPC.
*
* @see <a href="https://www.jsonrpc.org/specification#response_object" target="_blank">JSON-RPC 2.0
* Specification - Response object<a>
* Specification - Response object</a>
*/
@AllArgsConstructor
@Getter
Expand Down