mirror of
https://github.com/4sval/FModel.git
synced 2026-03-21 17:24:26 -05:00
70 lines
2.3 KiB
YAML
70 lines
2.3 KiB
YAML
name: FModel QA Builder
|
|
|
|
on:
|
|
push:
|
|
branches: [ dev ]
|
|
pull_request:
|
|
branches: [ dev ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- name: GIT Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'true'
|
|
|
|
- name: Fetch Submodules Recursively
|
|
run: git submodule update --init --recursive
|
|
|
|
- name: .NET 6 Setup
|
|
uses: actions/setup-dotnet@v2
|
|
with:
|
|
dotnet-version: '6.0.x'
|
|
|
|
- name: .NET Restore
|
|
run: dotnet restore FModel
|
|
|
|
- name: Get Version
|
|
id: package_version
|
|
uses: KageKirin/get-csproj-version@v1.0.0
|
|
with:
|
|
file: FModel/FModel.csproj
|
|
regex: '^(?<major>[0-9])\.(?<minor>[0-9])\.(?<buildmetadata>[0-9])\.(?<patch>[0-9])$'
|
|
|
|
- name: .NET Publish
|
|
run: dotnet publish FModel -c Release --no-self-contained -r win-x64 -f net6.0-windows -o "./FModel/bin/Publish/" -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:DebugType=None -p:GenerateDocumentationFile=false -p:DebugSymbols=false
|
|
|
|
- name: ZIP File
|
|
uses: papeloto/action-zip@v1
|
|
with:
|
|
files: ./FModel/bin/Publish/FModel.exe
|
|
dest: ${{ github.sha }}.zip # will end up in working directory not the Publish folder
|
|
|
|
- name: Edit QA Artifact
|
|
id: edited_release
|
|
uses: johnwbyrd/update-release@v1.0.0
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
release: FModel QA Testing
|
|
tag: qa
|
|
prerelease: true
|
|
files: ${{ github.sha }}.zip
|
|
|
|
- name: FModel Auth
|
|
id: fmodel_auth
|
|
uses: fjogeleit/http-request-action@v1.14.1
|
|
with:
|
|
url: "https://api.fmodel.app/v1/oauth/token"
|
|
data: '{"username": "${{ secrets.API_USERNAME }}", "password": "${{ secrets.API_PASSWORD }}"}'
|
|
|
|
- name: FModel Deploy Build
|
|
uses: fjogeleit/http-request-action@v1.14.1
|
|
with:
|
|
url: "https://api.fmodel.app/v1/infos/${{ secrets.QA_ID }}"
|
|
method: "PATCH"
|
|
bearerToken: ${{ fromJson(steps.fmodel_auth.outputs.response).accessToken }}
|
|
data: '{"version": "${{ steps.package_version.outputs.version }}-dev+${{ github.sha }}", "downloadUrl": "https://github.com/4sval/FModel/releases/download/qa/${{ github.sha }}.zip"}'
|