Skip to content

Commit

Permalink
Update auto release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
krispyking24 authored Aug 6, 2024
1 parent a7d00b4 commit b1bede9
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions .github/workflows/auto release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: AutoRelease

on:
workflow_dispatch: # Allows manual triggering
push:
branches: [ master ]

Expand All @@ -12,7 +11,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -27,21 +26,36 @@ jobs:
- name: Install unzip
run: sudo apt-get update && sudo apt-get install -y unzip

- name: Find and Extract .jar from ZIP
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: Artifacts
path: ./build/libs

- name: Unzip Artifact
run: |
ZIP_FILE=$(find . -type f -name "*.zip")
echo "Found ZIP file: $ZIP_FILE"
unzip -j "$ZIP_FILE" "*.jar" -d ./extracted
echo "Unzipping artifact..."
unzip -d ./extracted ./build/libs/Artifacts.zip
ls -l ./extracted
- name: Create and Push Tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG_NAME="v${{ github.run_number }}"
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git tag $TAG_NAME
git push origin $TAG_NAME
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "latest" # You can use a fixed name or format
release_name: "Release latest"
tag_name: ${{ steps.create_and_push_tag.outputs.tag }}
release_name: "Release ${{ steps.create_and_push_tag.outputs.tag }}"
body: |
Changes in this release:
- Add your changes here
Expand All @@ -51,7 +65,7 @@ jobs:
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./extracted/*.jar
Expand Down

0 comments on commit b1bede9

Please sign in to comment.