Skip to content
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
36 changes: 36 additions & 0 deletions .github/workflows/netcetera-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Netcetera - Publish To Maven Central
on:
workflow_dispatch:

permissions:
contents: read

jobs:
netcetera-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Build
run: ./gradlew :netcetera-3ds-core:assembleProductionRelease

- name: Publish To Maven Central
run: ./gradlew :netcetera-3ds-core:publishProductionReleasePublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository --max-workers=1
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
DEVELOPER_ID: ${{ secrets.DEVELOPER_ID }}
DEVELOPER_NAME: ${{ secrets.DEVELOPER_NAME }}
DEVELOPER_EMAIL: ${{ secrets.DEVELOPER_EMAIL }}
24 changes: 20 additions & 4 deletions .github/workflows/netcetera-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,39 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Download & Unpack
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Download & Bundle
run: |
chmod +x ./netcetera-3ds-core/scripts/download-and-unpack.sh
./netcetera-3ds-core/scripts/download-and-unpack.sh "${{ inputs.url }}"
chmod +x ./netcetera-3ds-core/scripts/download-and-bundle.sh
./netcetera-3ds-core/scripts/download-and-bundle.sh "${{ inputs.url }}"

- name: Update Version
run: |
source netcetera-3ds-core/scripts/update-version.sh "${{ inputs.version }}"
echo "UPDATED_VERSION=$(cat netcetera-3ds-core/version.resolved)" >> $GITHUB_ENV

- name: Build Verification
run: ./gradlew :netcetera-3ds-core:assembleProductionRelease

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5.0.0
with:
token: ${{ secrets.PO_GITHUB_TOKEN }}
add-paths: |
netcetera-3ds-core/src/main/assets/**
netcetera-3ds-core/src/main/jniLibs/**
netcetera-3ds-core/src/main/res/**
netcetera-3ds-core/libs/classes.jar
netcetera-3ds-core/netcetera-consumer-rules.pro
netcetera-3ds-core/dexguard.txt
netcetera-3ds-core/version.resolved
commit-message: Update Netcetera
commit-message: 'chore: Update Netcetera to ${{ env.UPDATED_VERSION }}'
branch: chore/netcetera-update-${{ env.UPDATED_VERSION }}
delete-branch: true
title: 'chore: Update Netcetera to ${{ env.UPDATED_VERSION }}'
Expand Down
40 changes: 40 additions & 0 deletions netcetera-3ds-core/scripts/download-and-bundle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

if [ -z "$1" ]; then
echo "Usage: $0 <URL>"
exit 1
fi

URL="$1"
FILENAME=$(basename "$URL")
SDK_DIR="${FILENAME%.*}"

if curl -L "$URL" -o "$FILENAME"; then
echo "Downloaded $FILENAME successfully."
else
echo "Failed to download: $URL"
exit 1
fi

unzip -o "$FILENAME" -d "$SDK_DIR"

# assets
rm -rf netcetera-3ds-core/src/main/assets/*
cp -r "$SDK_DIR"/assets/* netcetera-3ds-core/src/main/assets/

# jniLibs
rm -rf netcetera-3ds-core/src/main/jniLibs/*
cp -r "$SDK_DIR"/jni/* netcetera-3ds-core/src/main/jniLibs/

# res
rm -rf netcetera-3ds-core/src/main/res/*
cp -r "$SDK_DIR"/res/* netcetera-3ds-core/src/main/res/

# classes.jar
cp -f "$SDK_DIR"/classes.jar netcetera-3ds-core/libs/

# proguard & dexguard
cp -f "$SDK_DIR"/proguard.txt netcetera-3ds-core/netcetera-consumer-rules.pro
cp -f "$SDK_DIR"/dexguard.txt netcetera-3ds-core/

echo "Netcetera $FILENAME has been bundled successfully."
24 changes: 0 additions & 24 deletions netcetera-3ds-core/scripts/download-and-unpack.sh

This file was deleted.