Skip to content

Commit

Permalink
Create wsa.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
wxy1343 authored Aug 24, 2022
1 parent c60eed1 commit 0df5bbb
Showing 1 changed file with 155 additions and 0 deletions.
155 changes: 155 additions & 0 deletions .github/workflows/wsa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: Build WSA

on:
workflow_dispatch:
inputs:
arch:
description: "Build arch"
required: true
default: "x64 & arm64"
type: choice
options:
- x64
- arm64
- x64 & arm64
release_type:
description: "WSA release type"
required: true
default: "retail"
type: choice
options:
- retail
- release preview
- insider slow
- insider fast
magisk_apk:
description: "Magisk version"
required: true
default: "stable"
type: choice
options:
- stable
- beta
- canary
- debug
gapps_variant:
description: "Variants of gapps"
required: true
default: "pico"
type: choice
options:
- none
- super
- stock
- full
- mini
- micro
- nano
- pico
- tvstock
- tvmini
remove_amazon:
description: "Remove Amazon AppStore"
required: true
default: "keep"
type: choice
options:
- keep
- remove
root_sol:
description: "Root solution"
required: true
default: "magisk"
type: choice
options:
- magisk
- none
jobs:
matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Generate build matrix
id: set-matrix
uses: actions/github-script@v6
with:
script: |
let matrix = {};
let arch = "${{ github.event.inputs.arch }}"
switch ( arch ) {
case "x64":
matrix.arch = ["x64"];
break;
case "arm64":
matrix.arch = ["arm64"];
break;
default:
matrix.arch = ["x64", "arm64"];
break;
}
core.setOutput("matrix",JSON.stringify(matrix));
build:
runs-on: ubuntu-latest
needs: matrix
strategy:
matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v3

- id: run
env:
ARCH: ${{ matrix.arch }}
RELEASE_TYPE: ${{ github.event.inputs.release_type }}
MAGISK_VER: ${{ github.event.inputs.magisk_apk }}
GAPPS_VARIANT: ${{ github.event.inputs.gapps_variant }}
REMOVE_AMAZON: ${{ github.event.inputs.remove_amazon }}
ROOT_SOL: ${{ github.event.inputs.root_sol }}
run: |
./scripts/run.sh
path=$(find ./output -name "*.7z"|head -n 1)
echo "##[set-output name=path;]$path"
echo "##[set-output name=name;]$(basename $path)"
- id: vars
run: |
echo "::set-output name=sha_short::$(git rev-parse --short "$GITHUB_SHA")"
- uses: mukunku/[email protected]
id: checkTag
with:
tag: ${{ steps.vars.outputs.sha_short }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- id: create_release
uses: actions/create-release@v1
if: ${{ steps.checkTag.outputs.exists == 'false' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.vars.outputs.sha_short }}
release_name: MagiskOnWSA
draft: false
prerelease: false

- uses: juliangruber/sleep-action@v1
with:
time: 10s

- id: latest_release_info
uses: jossef/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.latest_release_info.outputs.upload_url }}
asset_path: ${{ steps.run.outputs.path }}
asset_name: ${{ steps.run.outputs.name }}
asset_content_type: application/x-7z-compressed

0 comments on commit 0df5bbb

Please sign in to comment.