-
Notifications
You must be signed in to change notification settings - Fork 9
60 lines (52 loc) · 1.57 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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