Skip to content

Commit

Permalink
ci: the more you try the worse it gets
Browse files Browse the repository at this point in the history
  • Loading branch information
esauvisky authored Nov 13, 2023
1 parent 782fe0f commit 5aa7e65
Showing 1 changed file with 32 additions and 24 deletions.
56 changes: 32 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,53 @@ on:
workflow_dispatch:

jobs:
pre-release:
name: "Release"
build-and-release:
name: "Build and Release"
runs-on: ubuntu-latest
strategy:
matrix:
branch: [master, standalone]

steps:
- name: "Checkout Master Branch"
- name: "Checkout Code"
uses: actions/checkout@v3
with:
ref: 'master'
ref: ${{ matrix.branch }}

- name: "Build Master"
- name: "Prepare Build"
run: |
ver=$(sed -n "s|^versionCode=||p" module.prop)
echo "VERSION_CODE=$ver" >> $GITHUB_ENV
name=$(sed -n "s|^name=||p" module.prop | sed "s| |-|g")
newVersion=$(echo $ver | sed 's|\(.\)\(.\)\(.\)|\1.\2.\3|')
zip -r "${name}-${newVersion}.zip" . -x ".git/*" "LICENSE" "build.sh" ".gitignore" "*.zip"
echo "Made ${name}-${newVersion} ($ver)"
mv "${name}-${newVersion}.zip" "eMagisk-full-${ver}.zip"
zipName="${name}-${newVersion}-${{ matrix.branch }}.zip"
echo "ZIP_NAME=$zipName" >> $GITHUB_ENV
- name: "Checkout Standalone Branch"
uses: actions/checkout@v3
- name: "Build ZIP"
run: |
zip -r "${{ env.ZIP_NAME }}" . -x ".git/*" "LICENSE" "build.sh" ".gitignore" "*.zip"
echo "Built ${{ env.ZIP_NAME }}"
- name: "Upload ZIP to Artifacts"
uses: actions/upload-artifact@v2
with:
ref: 'standalone'
name: ${{ env.ZIP_NAME }}
path: ${{ env.ZIP_NAME }}

- name: "Build Standalone"
run: |
ver=$(sed -n "s|^versionCode=||p" module.prop)
name=$(sed -n "s|^name=||p" module.prop | sed "s| |-|g")
newVersion=$(echo $ver | sed 's|\(.\)\(.\)\(.\)|\1.\2.\3|')
zip -r "${name}-${newVersion}.zip" . -x ".git/*" "LICENSE" "build.sh" ".gitignore" "*.zip"
echo "Made ${name}-${newVersion} ($ver)"
mv "${name}-${newVersion}.zip" "eMagisk-noatlas-${ver}.zip"
create-release:
needs: build-and-release
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
path: zips/

- uses: "marvinpinto/action-automatic-releases@latest"
- name: "Create GitHub Release"
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Latest Release v${{ env.MASTER_VERSION_CODE }} & v${{ env.STANDALONE_VERSION_CODE }}"
title: "Latest Release"
files: |
eMagisk-full-${{ env.MASTER_VERSION_CODE }}.zip
eMagisk-noatlas-${{ env.STANDALONE_VERSION_CODE }}.zip
zips/*.zip

0 comments on commit 5aa7e65

Please sign in to comment.