This commit is contained in:
Syer10
2025-01-12 13:58:21 -05:00
parent 81aff9614f
commit dad629aaff

View File

@@ -4,6 +4,7 @@ on:
push: push:
branches: branches:
- master - master
pull_request:
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
@@ -160,76 +161,76 @@ jobs:
path: upload/* path: upload/*
if-no-files-found: error if-no-files-found: error
release: # release:
needs: bundle # needs: bundle
runs-on: ubuntu-latest # runs-on: ubuntu-latest
steps: # steps:
- uses: actions/download-artifact@v4 # - uses: actions/download-artifact@v4
with: # with:
name: jar # name: jar
path: release # path: release
- uses: actions/download-artifact@v4 # - uses: actions/download-artifact@v4
with: # with:
name: debian-all # name: debian-all
path: release # path: release
- uses: actions/download-artifact@v4 # - uses: actions/download-artifact@v4
with: # with:
name: linux-assets # name: linux-assets
path: release # path: release
- uses: actions/download-artifact@v4 # - uses: actions/download-artifact@v4
with: # with:
name: linux-x64 # name: linux-x64
path: release # path: release
- uses: actions/download-artifact@v4 # - uses: actions/download-artifact@v4
with: # with:
name: macOS-x64 # name: macOS-x64
path: release # path: release
- uses: actions/download-artifact@v4 # - uses: actions/download-artifact@v4
with: # with:
name: macOS-arm64 # name: macOS-arm64
path: release # path: release
- uses: actions/download-artifact@v4 # - uses: actions/download-artifact@v4
with: # with:
name: windows-x64 # name: windows-x64
path: release # path: release
#
- name: Checkout Preview branch # - name: Checkout Preview branch
uses: actions/checkout@v4 # uses: actions/checkout@v4
with: # with:
repository: "Suwayomi/Suwayomi-Server-preview" # repository: "Suwayomi/Suwayomi-Server-preview"
ref: main # ref: main
path: preview # path: preview
token: ${{ secrets.DEPLOY_PREVIEW_TOKEN }} # token: ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
#
- name: Generate Tag Name # - name: Generate Tag Name
id: GenTagName # id: GenTagName
run: | # run: |
cd release # cd release
genTag=$(ls *.jar | sed -e's/Suwayomi-Server-\|.jar//g') # genTag=$(ls *.jar | sed -e's/Suwayomi-Server-\|.jar//g')
echo "$genTag" # echo "$genTag"
echo "value=$genTag" >> $GITHUB_OUTPUT # echo "value=$genTag" >> $GITHUB_OUTPUT
#
- name: Create Tag # - name: Create Tag
run: | # run: |
TAG="${{ steps.GenTagName.outputs.value }}" # TAG="${{ steps.GenTagName.outputs.value }}"
echo "tag: $TAG" # echo "tag: $TAG"
cd preview # cd preview
echo "{ \"latest\": \"$TAG\" }" > index.json # echo "{ \"latest\": \"$TAG\" }" > index.json
git add index.json # git add index.json
git config --global user.email \ # git config --global user.email \
"github-actions[bot]@users.noreply.github.com" # "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]" # git config --global user.name "github-actions[bot]"
git commit -m "Updated to $TAG" # git commit -m "Updated to $TAG"
git push origin main # git push origin main
#
git tag $TAG # git tag $TAG
git push origin $TAG # git push origin $TAG
#
- name: Upload Preview Release # - name: Upload Preview Release
uses: softprops/action-gh-release@v2 # uses: softprops/action-gh-release@v2
with: # with:
token: ${{ secrets.DEPLOY_PREVIEW_TOKEN }} # token: ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
repository: "Suwayomi/Suwayomi-Server-preview" # repository: "Suwayomi/Suwayomi-Server-preview"
tag_name: ${{ steps.GenTagName.outputs.value }} # tag_name: ${{ steps.GenTagName.outputs.value }}
files: release/* # files: release/*