Skip to content

Commit

Permalink
Update auto release.yml
Browse files Browse the repository at this point in the history
Update main.yml

Update main.yml

Update main.yml

Create main.yml

Update auto release.yml
  • Loading branch information
krispyking24 authored and krispyking24 committed Aug 9, 2024
1 parent d23e00b commit 7633418
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 13 deletions.
38 changes: 25 additions & 13 deletions .github/workflows/auto release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,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 @@ -26,24 +26,36 @@ jobs:
- name: Install unzip
run: sudo apt-get update && sudo apt-get install -y unzip

- name: Find and Extract .jar from ZIP
run: |
# Find the ZIP file
ZIP_FILE=$(find . -type f -name "*.zip")
echo "Found ZIP file: $ZIP_FILE"
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: Artifacts
path: ./build/libs

# Extract the .jar file from the ZIP
unzip -j "$ZIP_FILE" "*.jar" -d ./extracted
- name: Unzip Artifact
run: |
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: ${{ github.ref }}
release_name: Release ${{ github.ref }}
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 @@ -53,9 +65,9 @@ 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
asset_name: $(basename ./extracted/*.jar)
asset_content_type: application/java-archive
asset_content_type: application/java-archive
26 changes: 26 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This is a basic workflow to help you get started with the GitHub Auto-Release on Commit Action.

name: AutoRelease

on:
push:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
release:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- uses: CupOfTea696/[email protected]
with:
title: "Release: $version"
tag: "v$semver"
draft: false
regex: "/^Release: #{semver}$/i"
env:
GITHUB_TOKEN: ${{ secrets.GB_TOKEN }}

0 comments on commit 7633418

Please sign in to comment.