mirror of
https://github.com/JDM170/ReVanced_Builder
synced 2025-11-29 14:41:46 +07:00
Create test.yml
This commit is contained in:
42
.github/workflows/test.yml
vendored
Normal file
42
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
name: test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "*"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
patch:
|
||||||
|
runs-on: windows-latest
|
||||||
|
timeout-minutes: 5
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@main
|
||||||
|
|
||||||
|
- name: test.md
|
||||||
|
id: read_release
|
||||||
|
run: |
|
||||||
|
# https://en.wikipedia.org/wiki/Percent-encoding
|
||||||
|
$Release = (Get-Content -Path test.md -Encoding utf8 -Raw).replace("`n", "%0A").replace("`r", "%0D")
|
||||||
|
|
||||||
|
$Parameters = @{
|
||||||
|
Uri = "https://api.github.com/repos/Sophia-Community/SophiApp/releases"
|
||||||
|
UseBasicParsing = $true
|
||||||
|
Verbose = $true
|
||||||
|
}
|
||||||
|
$Penultimate = (Invoke-RestMethod @Parameters).tag_name | Select-Object -Index 1
|
||||||
|
$Release.replace("NewVersion", "${{ github.ref }}").replace("ReleaseDate", "$((Get-Date).ToShortDateString())").replace("OldVersion", "$($Penultimate)")
|
||||||
|
|
||||||
|
# https://trstringer.com/github-actions-multiline-strings/
|
||||||
|
echo "::set-output name=RELEASE_BODY::$Release"
|
||||||
|
|
||||||
|
- name: Uploading
|
||||||
|
uses: svenstaro/upload-release-action@master
|
||||||
|
with:
|
||||||
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
file: test.md
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
body: ${{ steps.read_release.outputs.RELEASE_BODY }}
|
||||||
|
overwrite: true
|
||||||
|
file_glob: true
|
||||||
|
prerelease: true
|
||||||
Reference in New Issue
Block a user