XRNX Package and Release (Older Version) #3
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: XRNX Package and Release (Older Version) | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
package-and-release-older-version: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
# Set up Git (required for tagging) | |
- name: Set up Git | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
# Modify main.lua: Comment out PakettieSpeak and PakettiBeatDetect require lines | |
- name: Modify main.lua | |
run: | | |
sed -i '/require\s*["'\'']PakettieSpeak["'\'']/s/^/-- /' main.lua | |
sed -i '/require\s*["'\'']PakettiBeatDetect["'\'']/s/^/-- /' main.lua | |
# Comment out specific function in Paketti0G01_Loader.lua | |
- name: Comment out function in Paketti0G01_Loader.lua | |
run: | | |
sed -i '/function update_loadPaleGreenTheme_preferences()/,/end/s/^/-- /' Paketti0G01_Loader.lua | |
# Remove style attributes (with or without spaces around =) from all .lua files | |
- name: Remove style attributes from .lua files | |
run: | | |
find . -type f -name "*.lua" -exec sed -i 's/style\s*=\s*"[^"]*"//g' {} + | |
# Modify manifest.xml: Change ApiVersion from 6 to 5 | |
- name: Modify manifest.xml | |
run: | | |
sed -i 's/<ApiVersion>6<\/ApiVersion>/<ApiVersion>5<\/ApiVersion>/g' manifest.xml | |
# Zip the modified contents, excluding Git and GitHub directories | |
- name: Zip XRNX Package (Older Version) | |
run: zip -r org.lackluster.Paketti_V3.54.xrnx . -x "*.git*" "*.github*" | |
# Dynamically generate a tag name for the older version and set it as an environment variable | |
- name: Generate Tag Name for Older Version | |
run: | | |
echo "TAG_NAME=older-v-$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV | |
# Create a tag with the generated tag name | |
- name: Create and Push Tag | |
run: | | |
git tag $TAG_NAME | |
git push origin $TAG_NAME | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Create a GitHub release using the generated tag name | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.TAG_NAME }} | |
release_name: Older Version Release ${{ env.TAG_NAME }} | |
draft: false | |
prerelease: false | |
# Upload the older version XRNX file to the GitHub release | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./org.lackluster.Paketti_V3.54.xrnx | |
asset_name: org.lackluster.Paketti_V3.54.older.xrnx | |
asset_content_type: application/octet-stream |