v7.4.4 #152
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: Release | |
on: | |
workflow_dispatch: | |
release: | |
types: | |
- published | |
jobs: | |
Build_Executable: | |
name: Build JAR Files | |
permissions: | |
contents: write | |
checks: write | |
actions: read | |
issues: read | |
packages: write | |
pull-requests: read | |
repository-projects: read | |
statuses: read | |
secrets: inherit | |
uses: ./.github/workflows/build_maven.yml | |
Build_Installers: | |
name: Generate Installers | |
needs: Build_Executable | |
uses: ./.github/workflows/build_installers.yml | |
secrets: inherit | |
Build_SPK: | |
name: Generate Synology Package | |
needs: Build_Executable | |
uses: ./.github/workflows/build_spk.yml | |
with: | |
image: registry.cn-hangzhou.aliyuncs.com/ghostchu/peerbanhelper:${{ github.ref_name }} | |
Build_DEB: | |
name: Generate Debian Package | |
needs: Build_Executable | |
uses: ./.github/workflows/build_deb.yml | |
Build_PKG: | |
name: Generate FreeBSD Package | |
needs: Build_Executable | |
uses: ./.github/workflows/build_pkg.yml | |
Build_Portable: | |
name: Generate Portable Version | |
needs: Build_Executable | |
uses: ./.github/workflows/build_portable.yml | |
Empty_Old_S3_Files: | |
name: Delete Outdate file in S3 | |
if: ${{ github.event_name == 'release' && !github.event.release.prerelease }} | |
needs: [Build_Executable, Build_Installers, Build_SPK, Build_DEB, Build_PKG, Build_Portable] | |
uses: ./.github/workflows/delete_old_s3_objects.yml | |
secrets: inherit | |
Upload_Updates_To_S3: | |
name: Update To S3 | |
if: ${{ github.event_name == 'release' && !github.event.release.prerelease }} | |
needs: [ Build_Executable, Build_Installers, Build_SPK, Build_DEB, Build_PKG, Build_Portable, Empty_Old_S3_Files ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: installer-dist | |
path: target/media | |
- uses: shallwefootball/s3-upload-action@master | |
with: | |
aws_key_id: ${{ secrets.S3_ACCESS_KEY }} | |
aws_secret_access_key: ${{ secrets.S3_SECRET_KEY }} | |
aws_bucket: ${{ secrets.S3_BUCKET }} | |
endpoint: ${{ secrets.S3_ENDPOINT }} | |
source_dir: 'target/media' | |
destination_dir: 'updates/latest' | |
Clear_CloudFlare_Updates: | |
name: Clear CloudFlare Cache | |
if: ${{ github.event_name == 'release' && !github.event.release.prerelease }} | |
needs: [Upload_Updates_To_S3] | |
uses: ./.github/workflows/flush_cloudflare_cache.yml | |
secrets: inherit | |
Upload_Artifacts: | |
name: Upload Release Artifacts | |
continue-on-error: true | |
if: github.event_name != 'workflow_dispatch' | |
needs: [Build_Executable, Build_Installers, Build_SPK, Build_DEB, Build_PKG, Build_Portable] | |
permissions: | |
contents: write | |
checks: write | |
actions: read | |
issues: read | |
packages: write | |
pull-requests: read | |
repository-projects: read | |
statuses: read | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: maven-dist | |
path: target/ | |
- uses: actions/download-artifact@v4 | |
with: | |
name: installer-dist | |
path: target/media | |
- uses: actions/download-artifact@v4 | |
with: | |
name: spk-dist | |
path: target/media | |
- uses: actions/download-artifact@v4 | |
with: | |
name: deb-dist | |
path: target/media | |
- uses: actions/download-artifact@v4 | |
with: | |
name: portable-dist | |
path: target/media | |
- uses: actions/download-artifact@v4 | |
with: | |
name: freebsd-pkg-13.4-dist | |
path: target/media | |
- uses: actions/download-artifact@v4 | |
with: | |
name: freebsd-pkg-14.1-dist | |
path: target/media | |
- name: Zip medias for create torrent | |
run: tar -zcvf PeerBanHelper_Installers.tar.gz target/media/ | |
- name: Install mktorrent | |
run: sudo apt-get install -y mktorrent | |
- name: Determine version | |
id: set_version | |
run: | | |
if [[ "${{ github.ref_type }}" == "tag" ]]; then | |
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT | |
else | |
SHORT_SHA=$(git rev-parse --short "${{ github.sha }}") | |
echo "version=sha-$SHORT_SHA" >> $GITHUB_OUTPUT | |
fi | |
- name: Create copy of Installers archive | |
run: cp PeerBanHelper_Installers.tar.gz "PeerBanHelper_Installers_${{ steps.set_version.outputs.version }}.tar.gz" | |
- name: Make torrent | |
run: | | |
mktorrent -t 8 \ | |
-a udp://tracker.opentrackr.org:1337/announce \ | |
-a udp://tracker.publicbt.com:80/announce \ | |
-a udp://tracker.openbittorrent.com:80/announce \ | |
-a https://sparkle.ghostchu-services.top/announce \ | |
-a udp://opentracker.io:6969/announce \ | |
-a wss://tracker.openwebtorrent.com:443/announce \ | |
-c "PeerBanHelper/${{ github.ref }} (${{ github.sha }}) on ${{ github.repository }}. Published by ${{ github.repository_owner }}." \ | |
-w "https://github.com/${{ github.repository }}/releases/download/${{ steps.set_version.outputs.version }}/PeerBanHelper_Installers.tar.gz" \ | |
-o peerbanhelper.torrent \ | |
"PeerBanHelper_Installers_${{ steps.set_version.outputs.version }}.tar.gz" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: torrent-dist | |
path: | | |
peerbanhelper.torrent | |
PeerBanHelper_Installers.tar.gz | |
id: project | |
- uses: alexellis/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
asset_paths: '["target/media/PeerBanHelper_*", "target/media/peerbanhelper_*", "target/media/peerbanhelper-*", "target/media/_____UNSUPPORTED_PeerBanHelper_*", "peerbanhelper.torrent", "PeerBanHelper_Installers.tar.gz"]' | |
Build_Docker: | |
name: Build Docker Image | |
if: github.event_name != 'workflow_dispatch' | |
permissions: | |
contents: write | |
checks: write | |
actions: read | |
issues: read | |
packages: write | |
pull-requests: read | |
repository-projects: read | |
statuses: read | |
needs: Build_Executable | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: maven-dist | |
path: target | |
- name: Set Up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set Up Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/[email protected] | |
with: | |
images: ghostchu/peerbanhelper | |
tags: | | |
type=ref,event=branch | |
type=ref,event=tag | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=raw,latest-jvm-universal | |
type=raw,latest | |
type=sha | |
- name: Build and push Docker image | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
platforms: | | |
linux/amd64 | |
linux/arm64/v8 | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }}-jvm-universal | |
cache-from: type=gha | |
cache-to: type=gha,mode=min | |
build-args: | | |
GIT_HASH=${{ github.sha }} | |
- name: Log in to Aliyun ACR | |
uses: docker/login-action@v3 | |
with: | |
registry: "registry.cn-hangzhou.aliyuncs.com" | |
username: ${{ secrets.ALIYUN_ACR_USERNAME }} | |
password: ${{ secrets.ALIYUN_ACR_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Aliyun ACR | |
id: meta-acr | |
uses: docker/[email protected] | |
with: | |
images: registry.cn-hangzhou.aliyuncs.com/ghostchu/peerbanhelper | |
tags: | | |
type=ref,event=branch | |
type=ref,event=tag | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=raw,latest-jvm-universal | |
type=raw,latest | |
type=sha | |
- name: Build and push Aliyun ACR | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: ./Dockerfile-Release | |
push: true | |
platforms: | | |
linux/amd64 | |
linux/arm64/v8 | |
tags: ${{ steps.meta-acr.outputs.tags }} | |
labels: ${{ steps.meta-acr.outputs.labels }}-jvm-universal | |
cache-from: type=gha | |
cache-to: type=gha,mode=min |