Version 1.1.0 #18
Workflow file for this run
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: Build and Release | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "zulu" | |
java-version: "21" | |
- name: Build with Maven | |
run: mvn clean package | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release-jar | |
path: target/*.jar | |
- name: Publish release to R2 | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: 'us-east-1' | |
AWS_S3_BUCKET_NAME: ${{ secrets.AWS_BUCKET_NAME }} | |
CF_ACCOUNT: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
RELEASE: ${{ github.ref_name }} | |
run: | | |
aws s3 cp target/ s3://${AWS_S3_BUCKET_NAME}/FileToPNG/releases/tag/${RELEASE}/ \ | |
--recursive \ | |
--exclude "*" \ | |
--include "FileToPNG*.jar" \ | |
--quiet \ | |
--endpoint-url https://${CF_ACCOUNT}.eu.r2.cloudflarestorage.com | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: release-jar | |
path: target/ | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Release ${{ github.ref_name }} | |
draft: true | |
files: "target/*release.jar" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Release Information | |
run: echo "Release ${{ steps.create_release.outputs.upload_url }}" |