Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
on: | |
push: | |
branches: | |
- '2.2' | |
pull_request: | |
branches: | |
- '2.2' | |
release: | |
types: [ created ] | |
concurrency: | |
group: ci-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
compile-java: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Setup Java | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
java-package: jdk | |
architecture: x64 | |
- name: Compile | |
shell: bash | |
run: | | |
mvn \ | |
--batch-mode \ | |
--no-transfer-progress \ | |
compile | |
- name: Upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: target-cache | |
path: | | |
${{github.workspace}}/target | |
if-no-files-found: error | |
compile-apple-arm64: | |
needs: compile-java | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Download | |
uses: actions/[email protected] | |
with: | |
name: target-cache | |
path: ${{github.workspace}}/target | |
- name: Compile | |
env: | |
CC: clang | |
CFLAGS: '-O2 -g -target arm64-apple-macos10.5 -flto -fomit-frame-pointer -fno-stack-protector -pipe' | |
LDFLAGS: '-Wl,-dead_strip_dylibs' | |
shell: bash | |
run: | | |
mkdir -p target/build/libuiohook/ | |
cmake -B target/build/libuiohook/ -S src/external/libuiohook/ \ | |
-G "Unix Makefiles" \ | |
-D CMAKE_INSTALL_PREFIX=target/ \ | |
-D CMAKE_VERBOSE_MAKEFILE=ON \ | |
-D BUILD_SHARED_LIBS=OFF \ | |
-D USE_EPOCH_TIME=ON | |
cmake --build target/build/libuiohook/ \ | |
--parallel 2 \ | |
--clean-first | |
cmake --install target/build/libuiohook/ | |
mkdir -p target/build/jni/ | |
cmake -B target/build/jni/ \ | |
-G "Unix Makefiles" \ | |
-D CMAKE_PREFIX_PATH=target/ \ | |
-D CMAKE_SYSTEM_NAME=darwin \ | |
-D CMAKE_SYSTEM_PROCESSOR=arm64 \ | |
-D CMAKE_VERBOSE_MAKEFILE=ON | |
cmake --build target/build/jni/ \ | |
--parallel 2 \ | |
--clean-first | |
cmake --install target/build/jni/ | |
- name: Upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: library-resources | |
path: | | |
${{github.workspace}}/src/main/resources | |
if-no-files-found: error | |
compile-apple-x86_64: | |
needs: compile-java | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Download | |
uses: actions/[email protected] | |
with: | |
name: target-cache | |
path: ${{github.workspace}}/target | |
- name: Compile | |
env: | |
CC: clang | |
CFLAGS: '-O2 -g -target x86_64-apple-macos10.5 -flto -fomit-frame-pointer -fno-stack-protector -pipe' | |
LDFLAGS: '-Wl,-dead_strip_dylibs' | |
shell: bash | |
run: | | |
mkdir -p target/build/libuiohook/ | |
cmake -B target/build/libuiohook/ -S src/external/libuiohook/ \ | |
-G "Unix Makefiles" \ | |
-D CMAKE_INSTALL_PREFIX=target/ \ | |
-D CMAKE_VERBOSE_MAKEFILE=ON \ | |
-D BUILD_SHARED_LIBS=OFF \ | |
-D USE_EPOCH_TIME=ON | |
cmake --build target/build/libuiohook/ \ | |
--parallel 2 \ | |
--clean-first | |
cmake --install target/build/libuiohook/ | |
mkdir -p target/build/jni/ | |
cmake -B target/build/jni/ \ | |
-G "Unix Makefiles" \ | |
-D CMAKE_PREFIX_PATH=target/ \ | |
-D CMAKE_SYSTEM_NAME=darwin \ | |
-D CMAKE_SYSTEM_PROCESSOR=x86_64 \ | |
-D CMAKE_VERBOSE_MAKEFILE=ON | |
cmake --build target/build/jni/ \ | |
--parallel 2 \ | |
--clean-first | |
cmake --install target/build/jni/ | |
- name: Upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: library-resources | |
path: | | |
${{github.workspace}}/src/main/resources | |
if-no-files-found: error | |
compile-linux-arm: | |
needs: compile-java | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Download | |
uses: actions/[email protected] | |
with: | |
name: target-cache | |
path: ${{github.workspace}}/target | |
- name: Setup | |
shell: bash | |
run: | | |
sudo rm -Rf /etc/apt/sources.list.d | |
sudo bash -c 'source /etc/lsb-release && echo " | |
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu ${DISTRIB_CODENAME} main universe | |
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu ${DISTRIB_CODENAME}-updates main universe | |
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu ${DISTRIB_CODENAME}-backports main universe | |
deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports ${DISTRIB_CODENAME} main universe | |
deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports ${DISTRIB_CODENAME}-updates main universe | |
deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports ${DISTRIB_CODENAME}-backports main universe | |
" > /etc/apt/sources.list' | |
sudo dpkg --add-architecture armhf | |
sudo apt-get update -m | |
sudo apt-get install \ | |
binutils-arm-linux-gnueabihf \ | |
gcc-arm-linux-gnueabihf | |
sudo apt-get install \ | |
libx11-dev:armhf \ | |
libxtst-dev:armhf \ | |
libxt-dev:armhf \ | |
libxinerama-dev:armhf \ | |
libx11-xcb-dev:armhf \ | |
libxkbcommon-dev:armhf \ | |
libxkbcommon-x11-dev:armhf \ | |
libxkbfile-dev:armhf | |
- name: Compile | |
env: | |
CC: arm-linux-gnueabihf-gcc | |
CFLAGS: '-Os -march=armv7ve -mfpu=vfp -mfloat-abi=hard -g -flto -fomit-frame-pointer -fno-stack-protector -pipe' | |
LDFLAGS: '-fuse-ld=gold -Wl,-O1 -Wl,--as-needed' | |
PKG_CONFIG_PATH: '/usr/lib/arm-linux-gnueabihf/pkgconfig' | |
shell: bash | |
run: | | |
mkdir -p target/build/libuiohook/ | |
cmake -B target/build/libuiohook/ -S src/external/libuiohook/ \ | |
-G "Unix Makefiles" \ | |
-D CMAKE_INSTALL_PREFIX=target/ \ | |
-D CMAKE_VERBOSE_MAKEFILE=ON \ | |
-D BUILD_SHARED_LIBS=OFF \ | |
-D USE_EPOCH_TIME=ON | |
cmake --build target/build/libuiohook/ \ | |
--parallel 2 \ | |
--clean-first | |
cmake --install target/build/libuiohook/ | |
mkdir -p target/build/jni/ | |
cmake -B target/build/jni/ \ | |
-G "Unix Makefiles" \ | |
-D CMAKE_PREFIX_PATH=target/ \ | |
-D CMAKE_SYSTEM_NAME=linux \ | |
-D CMAKE_SYSTEM_PROCESSOR=arm \ | |
-D CMAKE_VERBOSE_MAKEFILE=ON | |
cmake --build target/build/jni/ \ | |
--parallel 2 \ | |
--clean-first | |
cmake --install target/build/jni/ | |
- name: Upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: library-resources | |
path: | | |
${{github.workspace}}/src/main/resources | |
if-no-files-found: error | |
compile-linux-arm64: | |
needs: compile-java | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Download | |
uses: actions/[email protected] | |
with: | |
name: target-cache | |
path: ${{github.workspace}}/target | |
- name: Setup | |
shell: bash | |
run: | | |
sudo rm -Rf /etc/apt/sources.list.d | |
sudo bash -c 'source /etc/lsb-release && echo " | |
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu ${DISTRIB_CODENAME} main universe | |
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu ${DISTRIB_CODENAME}-updates main universe | |
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu ${DISTRIB_CODENAME}-backports main universe | |
deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports ${DISTRIB_CODENAME} main universe | |
deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports ${DISTRIB_CODENAME}-updates main universe | |
deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports ${DISTRIB_CODENAME}-backports main universe | |
" > /etc/apt/sources.list' | |
sudo dpkg --add-architecture arm64 | |
sudo apt-get update -m | |
sudo apt-get install \ | |
binutils-aarch64-linux-gnu \ | |
gcc-aarch64-linux-gnu | |
sudo apt-get install \ | |
libx11-dev:arm64 \ | |
libxtst-dev:arm64 \ | |
libxt-dev:arm64 \ | |
libxinerama-dev:arm64 \ | |
libx11-xcb-dev:arm64 \ | |
libxkbcommon-dev:arm64 \ | |
libxkbcommon-x11-dev:arm64 \ | |
libxkbfile-dev:arm64 | |
- name: Compile | |
env: | |
CC: aarch64-linux-gnu-gcc | |
CFLAGS: '-Os -march=armv8-a+crc -mtune=cortex-a53 -g -flto -fomit-frame-pointer -fno-stack-protector -pipe' | |
LDFLAGS: '-fuse-ld=gold -Wl,-O1 -Wl,--as-needed' | |
PKG_CONFIG_PATH: '/usr/lib/aarch64-linux-gnu/pkgconfig' | |
shell: bash | |
run: | | |
mkdir -p target/build/libuiohook/ | |
cmake -B target/build/libuiohook/ -S src/external/libuiohook/ \ | |
-G "Unix Makefiles" \ | |
-D CMAKE_INSTALL_PREFIX=target/ \ | |
-D CMAKE_VERBOSE_MAKEFILE=ON \ | |
-D BUILD_SHARED_LIBS=OFF \ | |
-D USE_EPOCH_TIME=ON | |
cmake --build target/build/libuiohook/ \ | |
--parallel 2 \ | |
--clean-first | |
cmake --install target/build/libuiohook/ | |
mkdir -p target/build/jni/ | |
cmake -B target/build/jni/ \ | |
-G "Unix Makefiles" \ | |
-D CMAKE_PREFIX_PATH=target/ \ | |
-D CMAKE_SYSTEM_NAME=linux \ | |
-D CMAKE_SYSTEM_PROCESSOR=arm64 \ | |
-D CMAKE_VERBOSE_MAKEFILE=ON | |
cmake --build target/build/jni/ \ | |
--parallel 2 \ | |
--clean-first | |
cmake --install target/build/jni/ | |
- name: Upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: library-resources | |
path: | | |
${{github.workspace}}/src/main/resources | |
if-no-files-found: error | |
compile-linux-x86: | |
needs: compile-java | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Download | |
uses: actions/[email protected] | |
with: | |
name: target-cache | |
path: ${{github.workspace}}/target | |
- name: Setup | |
shell: bash | |
run: | | |
sudo rm -Rf /etc/apt/sources.list.d | |
sudo bash -c 'source /etc/lsb-release && echo " | |
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu ${DISTRIB_CODENAME} main universe | |
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu ${DISTRIB_CODENAME}-updates main universe | |
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu ${DISTRIB_CODENAME}-backports main universe | |
" > /etc/apt/sources.list' | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update -m | |
sudo apt-get install \ | |
binutils-i686-linux-gnu \ | |
gcc-i686-linux-gnu | |
sudo apt-get install \ | |
libx11-dev:i386 \ | |
libxtst-dev:i386 \ | |
libxt-dev:i386 \ | |
libxinerama-dev:i386 \ | |
libx11-xcb-dev:i386 \ | |
libxkbcommon-dev:i386 \ | |
libxkbcommon-x11-dev:i386 \ | |
libxkbfile-dev:i386 | |
- name: Compile | |
env: | |
CC: i686-linux-gnu-gcc | |
CFLAGS: '-O2 -march=i686 -mtune=generic -g -fomit-frame-pointer -flto -fno-stack-protector -pipe' | |
LDFLAGS: '-fuse-ld=gold -Wl,-O1 -Wl,--as-needed' | |
PKG_CONFIG_PATH: '/usr/lib/i386-linux-gnu/pkgconfig' | |
shell: bash | |
run: | | |
mkdir -p target/build/libuiohook/ | |
cmake -B target/build/libuiohook/ -S src/external/libuiohook/ \ | |
-G "Unix Makefiles" \ | |
-D CMAKE_INSTALL_PREFIX=target/ \ | |
-D CMAKE_VERBOSE_MAKEFILE=ON \ | |
-D BUILD_SHARED_LIBS=OFF \ | |
-D USE_EPOCH_TIME=ON | |
cmake --build target/build/libuiohook/ \ | |
--parallel 2 \ | |
--clean-first | |
cmake --install target/build/libuiohook/ | |
mkdir -p target/build/jni/ | |
cmake -B target/build/jni/ \ | |
-G "Unix Makefiles" \ | |
-D CMAKE_PREFIX_PATH=target/ \ | |
-D CMAKE_SYSTEM_NAME=linux \ | |
-D CMAKE_SYSTEM_PROCESSOR=x86 \ | |
-D CMAKE_VERBOSE_MAKEFILE=ON | |
cmake --build target/build/jni/ \ | |
--parallel 2 \ | |
--clean-first | |
cmake --install target/build/jni/ | |
- name: Upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: library-resources | |
path: | | |
${{github.workspace}}/src/main/resources | |
if-no-files-found: error | |
compile-linux-x86_64: | |
needs: compile-java | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Download | |
uses: actions/[email protected] | |
with: | |
name: target-cache | |
path: ${{github.workspace}}/target | |
- name: Setup | |
shell: bash | |
run: | | |
sudo apt-get update -m | |
sudo apt-get install \ | |
libx11-dev:amd64 \ | |
libxtst-dev:amd64 \ | |
libxt-dev:amd64 \ | |
libxinerama-dev:amd64 \ | |
libx11-xcb-dev:amd64 \ | |
libxkbcommon-dev:amd64 \ | |
libxkbcommon-x11-dev:amd64 \ | |
libxkbfile-dev:amd64 | |
- name: Compile | |
env: | |
CC: x86_64-linux-gnu-gcc | |
CFLAGS: '-O2 -march=x86-64 -mtune=generic -g -fomit-frame-pointer -flto -fno-stack-protector -pipe' | |
LDFLAGS: '-fuse-ld=gold -Wl,-O1 -Wl,--as-needed' | |
PKG_CONFIG_PATH: '/usr/lib/x86_64-linux-gnu/pkgconfig' | |
shell: bash | |
run: | | |
mkdir -p target/build/libuiohook/ | |
cmake -B target/build/libuiohook/ -S src/external/libuiohook/ \ | |
-G "Unix Makefiles" \ | |
-D CMAKE_INSTALL_PREFIX=target/ \ | |
-D CMAKE_VERBOSE_MAKEFILE=ON \ | |
-D BUILD_SHARED_LIBS=OFF \ | |
-D USE_EPOCH_TIME=ON | |
cmake --build target/build/libuiohook/ \ | |
--parallel 2 \ | |
--clean-first | |
cmake --install target/build/libuiohook/ | |
mkdir -p target/build/jni/ | |
cmake -B target/build/jni/ \ | |
-G "Unix Makefiles" \ | |
-D CMAKE_PREFIX_PATH=target/ \ | |
-D CMAKE_SYSTEM_NAME=linux \ | |
-D CMAKE_SYSTEM_PROCESSOR=x86_64 \ | |
-D CMAKE_VERBOSE_MAKEFILE=ON | |
cmake --build target/build/jni/ \ | |
--parallel 2 \ | |
--clean-first | |
cmake --install target/build/jni/ | |
- name: Upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: library-resources | |
path: | | |
${{github.workspace}}/src/main/resources | |
if-no-files-found: error | |
compile-windows-arm: | |
needs: compile-java | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Download | |
uses: actions/[email protected] | |
with: | |
name: target-cache | |
path: ${{github.workspace}}/target | |
- name: Setup | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: amd64_arm | |
- name: Compile | |
env: | |
CFLAGS: '/arch:ARMv7VE /O1 /Oy' | |
shell: cmd | |
run: | | |
md target\build\libuiohook\ | |
cmake -B target\build\libuiohook\ -S src\external\libuiohook\ ^ | |
-G "Visual Studio 17 2022" -A ARM ^ | |
-D CMAKE_INSTALL_PREFIX=target\ ^ | |
-D CMAKE_VERBOSE_MAKEFILE=ON ^ | |
-D BUILD_SHARED_LIBS=OFF ^ | |
-D USE_EPOCH_TIME=ON | |
cmake --build target\build\libuiohook\ ^ | |
--parallel 2 ^ | |
--config RelWithDebInfo ^ | |
--clean-first | |
cmake --install target\build\libuiohook\ ^ | |
--config RelWithDebInfo | |
md target\build\jni\ | |
cmake -B target\build\jni\ ^ | |
-G "Visual Studio 17 2022" -A ARM ^ | |
-D CMAKE_PREFIX_PATH=target\ ^ | |
-D CMAKE_SYSTEM_NAME=windows ^ | |
-D CMAKE_SYSTEM_PROCESSOR=arm ^ | |
-D CMAKE_VERBOSE_MAKEFILE=ON | |
cmake --build target\build\jni\ ^ | |
--parallel 2 ^ | |
--config RelWithDebInfo ^ | |
--clean-first | |
cmake --install target\build\jni\ ^ | |
--config RelWithDebInfo | |
- name: Upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: library-resources | |
path: | | |
${{github.workspace}}/src/main/resources | |
if-no-files-found: error | |
compile-windows-x86: | |
needs: compile-java | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Download | |
uses: actions/[email protected] | |
with: | |
name: target-cache | |
path: ${{github.workspace}}/target | |
- name: Setup | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: amd64_x86 | |
- name: Compile | |
shell: cmd | |
run: | | |
md target\build\libuiohook\ | |
cmake -B target\build\libuiohook\ -S src\external\libuiohook\ ^ | |
-G "Visual Studio 17 2022" -A Win32 ^ | |
-D CMAKE_INSTALL_PREFIX=target\ ^ | |
-D CMAKE_VERBOSE_MAKEFILE=ON ^ | |
-D BUILD_SHARED_LIBS=OFF ^ | |
-D USE_EPOCH_TIME=ON | |
cmake --build target\build\libuiohook\ ^ | |
--parallel 2 ^ | |
--config RelWithDebInfo ^ | |
--clean-first | |
cmake --install target\build\libuiohook\ ^ | |
--config RelWithDebInfo | |
md target\build\jni\ | |
cmake -B target\build\jni\ ^ | |
-G "Visual Studio 17 2022" -A Win32 ^ | |
-D CMAKE_PREFIX_PATH=target\ ^ | |
-D CMAKE_SYSTEM_NAME=windows ^ | |
-D CMAKE_SYSTEM_PROCESSOR=x86 ^ | |
-D CMAKE_VERBOSE_MAKEFILE=ON | |
cmake --build target\build\jni\ ^ | |
--parallel 2 ^ | |
--config RelWithDebInfo ^ | |
--clean-first | |
cmake --install target\build\jni\ ^ | |
--config RelWithDebInfo | |
- name: Upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: library-resources | |
path: | | |
${{github.workspace}}/src/main/resources | |
if-no-files-found: error | |
compile-windows-x86_64: | |
needs: compile-java | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Download | |
uses: actions/[email protected] | |
with: | |
name: target-cache | |
path: ${{github.workspace}}/target | |
- name: Setup | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: amd64 | |
- name: Compile | |
shell: cmd | |
run: | | |
md target\build\libuiohook\ | |
cmake -B target\build\libuiohook\ -S src\external\libuiohook\ ^ | |
-G "Visual Studio 17 2022" -A x64 ^ | |
-D CMAKE_INSTALL_PREFIX=target\ ^ | |
-D CMAKE_VERBOSE_MAKEFILE=ON ^ | |
-D BUILD_SHARED_LIBS=OFF ^ | |
-D USE_EPOCH_TIME=ON | |
cmake --build target\build\libuiohook\ ^ | |
--parallel 2 ^ | |
--config RelWithDebInfo ^ | |
--clean-first | |
cmake --install target\build\libuiohook\ ^ | |
--config RelWithDebInfo | |
md target\build\jni\ | |
cmake -B target\build\jni\ ^ | |
-G "Visual Studio 17 2022" -A x64 ^ | |
-D CMAKE_PREFIX_PATH=target\ ^ | |
-D CMAKE_SYSTEM_NAME=windows ^ | |
-D CMAKE_SYSTEM_PROCESSOR=x86_64 ^ | |
-D CMAKE_VERBOSE_MAKEFILE=ON | |
cmake --build target\build\jni\ ^ | |
--parallel 2 ^ | |
--config RelWithDebInfo ^ | |
--clean-first | |
cmake --install target\build\jni\ ^ | |
--config RelWithDebInfo | |
- name: Upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: library-resources | |
path: | | |
${{github.workspace}}/src/main/resources | |
if-no-files-found: error | |
package: | |
needs: [ | |
compile-apple-arm64, | |
compile-apple-x86_64, | |
compile-linux-arm, | |
compile-linux-arm64, | |
compile-linux-x86, | |
compile-linux-x86_64, | |
compile-windows-arm, | |
compile-windows-x86, | |
compile-windows-x86_64 | |
] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Download Cache | |
uses: actions/[email protected] | |
with: | |
name: target-cache | |
path: ${{github.workspace}}/target | |
- name: Download Libraries | |
uses: actions/[email protected] | |
with: | |
name: library-resources | |
path: ${{github.workspace}}/src/main/resources | |
- name: Setup Java | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
java-package: jdk | |
architecture: x64 | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
- name: Package | |
if: ${{ github.event_name != 'push' && github.event_name != 'release' }} | |
run: | | |
mvn \ | |
--batch-mode \ | |
--no-transfer-progress \ | |
package | |
- name: Setup GPG | |
if: ${{ github.event_name == 'push' || github.event_name == 'release' }} | |
run: | | |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import | |
gpg --list-secret-keys --keyid-format LONG | |
- name: Sonatype Snapshot | |
if: ${{ github.event_name == 'push' }} | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
shell: bash | |
run: | | |
mvn \ | |
-Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \ | |
--batch-mode \ | |
--no-transfer-progress \ | |
deploy | |
- name: Sonatype Release | |
if: ${{ github.event_name == 'release' && github.event.action == 'created' }} | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
shell: bash | |
run: | | |
mvn \ | |
-Drevision="${GITHUB_REF#refs/tags/}" \ | |
-Dgpg.passphrase="${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}" \ | |
--batch-mode \ | |
--no-transfer-progress \ | |
deploy | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-artifacts | |
path: | | |
${{github.workspace}}/target/*.jar | |
${{github.workspace}}/target/*.asc | |
${{github.workspace}}/target/*.pom | |
if-no-files-found: error | |
- name: Release Artifacts | |
if: ${{ github.event_name == 'release' && github.event.action == 'created' }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
${{github.workspace}}/target/*.jar | |
${{github.workspace}}/target/*.asc | |
${{github.workspace}}/target/*.pom | |
- name: Delete Cache | |
uses: geekyeggo/delete-artifact@v1 | |
with: | |
name: target-cache |