From 40a94212511ad6fba389ab6cf8bef78c1db97c0f Mon Sep 17 00:00:00 2001 From: JadianRadiator Date: Thu, 14 Mar 2024 19:30:26 -0500 Subject: [PATCH] uhhhh --- .github/workflows/generate_release.yml | 64 +++++++++++++++----------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/.github/workflows/generate_release.yml b/.github/workflows/generate_release.yml index ae262e9..c5f3f03 100644 --- a/.github/workflows/generate_release.yml +++ b/.github/workflows/generate_release.yml @@ -1,36 +1,48 @@ -# This is a basic workflow to help you get started with Actions - -name: Release Generator - -# Controls when the action will run. +name: Create Release on: - # Triggers the workflow on push or pull request events but only for the $default-branch branch push: - branches: [ $default-branch ] - pull_request: - branches: [ $default-branch ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + branches: + - main # Adjust this to your main branch name -# 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" build: - # 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: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Git + run: | + git config --global user.name 'JadianRadiator' + git config --global user.email 'jadianradiator@gmail.com' + + - name: Create and zip releases + run: | + # Function to zip the contents of a folder + function zip_folder_contents { + local folder="$1" + local zip_filename="$folder.zip" + pushd "$folder" >/dev/null || return + zip -r "../$zip_filename" . + popd >/dev/null || return + } - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo Hello, world! + # Check if there are any folders to zip + if [ -d */ ]; then + # Loop through each directory in the repository + for folder in */; do + folder="${folder%/}" # Remove trailing slash + zip_folder_contents "$folder" + done - # Runs a set of commands using the runners shell - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project. + echo "Zip archives created successfully." + else + echo "No folders found to zip." + fi + + - name: Commit and push changes + run: | + git add *.zip + git commit -m "Create release zip files" + git push