Skip to content

ci: last try

ci: last try #27

Workflow file for this run

name: "pre-release"
on:
push:
branches:
- "master"
- "standalone"
workflow_dispatch:
jobs:
build-and-release:
name: "Build and Release"
runs-on: ubuntu-latest
strategy:
matrix:
branch: [master, standalone]
steps:
- name: "Checkout Code"
uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}
- 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|')
zipName="${name}-${newVersion}-${{ matrix.branch }}.zip"
echo "ZIP_NAME=$zipName" >> $GITHUB_ENV
- 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:
name: ${{ env.ZIP_NAME }}
path: ${{ env.ZIP_NAME }}
create-release:
needs: build-and-release
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
path: zips/
- 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"
files: |
*.zip