feels like it won't work ever #7
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: Create Release | |
on: | |
push: | |
branches: | |
- main # Adjust this to your main branch name | |
env: | |
NODE_VERSION: 20 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Set up Git | |
run: | | |
git config --global user.name 'JadianRadiator' | |
git config --global user.email '[email protected]' | |
- 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 | |
} | |
# 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 | |
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 |