Nightly release #253
This file contains hidden or 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: Nightly release | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| env: | |
| version: ${microbot.version} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest # You can choose a different runner if needed | |
| permissions: write-all | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| # Specify the branch you want | |
| ref: development | |
| - name: Force sync with latest development | |
| run: | | |
| git fetch origin development | |
| git checkout development | |
| git reset --hard origin/development | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: temurin | |
| java-version: 11 | |
| - name: Build Shaded JAR | |
| run: | | |
| COMMIT_SHA=$(git rev-parse --short HEAD) | |
| mvn clean package -Dmicrobot.commit.sha=$COMMIT_SHA | |
| - name: Read microbot.version from POM | |
| id: version | |
| run: | | |
| V=$(mvn -q -f runelite-client/pom.xml help:evaluate \ | |
| -Dexpression=microbot.version -DforceStdout) | |
| # fallback to project.version if the property isn't defined | |
| if [ -z "$V" ]; then | |
| V=$(mvn -q -f runelite-client/pom.xml help:evaluate \ | |
| -Dexpression=project.version -DforceStdout) | |
| fi | |
| echo "version=$V" >> "$GITHUB_OUTPUT" | |
| echo "Using version: $V" | |
| - name: Create Release | |
| uses: "marvinpinto/action-automatic-releases@latest" | |
| with: | |
| repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
| automatic_release_tag: "nightly" | |
| prerelease: false | |
| title: "Nightly Build" | |
| files: | | |
| /home/runner/work/Microbot/Microbot/runelite-client/target/microbot-*.jar | |
| - name: Upload Jar to Hetzner | |
| uses: appleboy/scp-action@v0.1.7 | |
| with: | |
| host: ${{ secrets.PROD_HOST }} | |
| username: root | |
| key: ${{ secrets.PROD_SSH_KEY }} | |
| source: runelite-client/target/microbot-*.jar | |
| target: /var/www/files/releases/microbot/nightly/ | |
| strip_components: 2 | |
| - name: Set up Maven settings | |
| run: | | |
| mkdir -p ~/.m2 | |
| cat > ~/.m2/settings.xml <<EOL | |
| <settings> | |
| <servers> | |
| <server> | |
| <id>microbot-nightly</id> | |
| <username>${{ secrets.NEXUS_USER }}</username> | |
| <password>${{ secrets.NEXUS_PASSWORD }}</password> | |
| </server> | |
| </servers> | |
| </settings> | |
| EOL | |
| - name: Deploy to Nexus | |
| run: mvn deploy:deploy-file -DgroupId=com.microbot -DartifactId=client -Dversion=${{ steps.version.outputs.version }} -Dpackaging=jar -Dfile=runelite-client/target/microbot-${{ steps.version.outputs.version }}.jar -DrepositoryId=microbot-nightly -Durl=https://nexus.microbot.cloud/repository/microbot-nightly/ |