start-pr-checks #8071
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR Checks Dispatch | |
on: | |
repository_dispatch: | |
types: [start-pr-checks] | |
permissions: | |
issues: write | |
pull-requests: write | |
contents: write | |
jobs: | |
run-plogon: | |
name: Build Plugins | |
runs-on: ubuntu-latest | |
steps: | |
- uses: navikt/github-app-token-generator@v1 | |
id: get-token | |
with: | |
private-key: ${{ secrets.GH_APP_PK }} | |
app-id: ${{ secrets.GH_APP_ID }} | |
- uses: LouisBrunner/checks-action@v1.2.0 | |
id: register_check | |
with: | |
token: ${{ steps.get-token.outputs.token }} | |
name: Build PR | |
sha: ${{ github.event.client_payload.ref }} | |
status: in_progress | |
details_url: "https://github.com/goatcorp/DalamudPluginsD17/actions/runs/${{ github.run_id }}" | |
- name: Setup Difftastic | |
run: | | |
wget https://github.com/Wilfred/difftastic/releases/latest/download/difft-x86_64-unknown-linux-gnu.tar.gz | |
tar -xzf difft-x86_64-unknown-linux-gnu.tar.gz | |
sudo mv difft /usr/local/bin/difft | |
sudo chmod +x /usr/local/bin/difft | |
difft --version | |
- name: Setup terminal-to-html | |
run: | | |
wget https://github.com/buildkite/terminal-to-html/releases/download/v3.14.0/terminal-to-html-3.14.0-linux-amd64.gz | |
gunzip terminal-to-html-3.14.0-linux-amd64.gz | |
sudo chmod +x terminal-to-html-3.14.0-linux-amd64 | |
sudo mv terminal-to-html-3.14.0-linux-amd64 /usr/local/bin/terminal-to-html | |
terminal-to-html --version | |
- name: Checkout manifests from incoming PR | |
uses: actions/checkout@v3 | |
with: | |
repository: goatcorp/DalamudPluginsD17 | |
path: manifests | |
ref: ${{ github.event.client_payload.ref }} | |
- name: Checkout manifests from master | |
uses: actions/checkout@v3 | |
with: | |
repository: goatcorp/DalamudPluginsD17 | |
path: manifests-master | |
ref: main | |
- name: Checkout Plogon | |
uses: actions/checkout@v3 | |
with: | |
repository: goatcorp/Plogon | |
#ref: V1.0.6 | |
path: Plogon | |
- name: Checkout Dist | |
uses: actions/checkout@v3 | |
with: | |
repository: goatcorp/PluginDistD17 | |
path: output | |
ref: main | |
- name: Create required folders | |
run: | | |
mkdir artifacts | |
mkdir static | |
mkdir work | |
- name: Cache docker image | |
uses: actions/cache@v3 | |
env: | |
cache-name: ${{ secrets.EXTENDED_IMAGE_LINK }} | |
with: | |
path: ~/.plogon_cache | |
key: cache-${{ env.cache-name }} | |
- name: Run Plogon | |
id: plogon_run | |
working-directory: Plogon/Plogon | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_BOT_PAT }} | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
XLWEB_KEY: ${{ secrets.XLWEB_KEY }} | |
EXTENDED_IMAGE_LINK: ${{ secrets.EXTENDED_IMAGE_LINK }} | |
PLOGON_SECRETS_PK: ${{ secrets.PLOGON_SECRETS_PK }} | |
PLOGON_SECRETS_PK_PASSWORD: ${{ secrets.PLOGON_SECRETS_PK_PASSWORD }} | |
GITHUB_REPOSITORY: ${{ github.repository }} | |
PR_ACTOR: ${{ github.event.client_payload.actor }} | |
PLOGON_ACTOR: ${{ github.event.client_payload.actor }} | |
GITHUB_PR_NUM: ${{ github.event.client_payload.prnum }} | |
GITHUB_RUN_ID: ${{ github.run_id }} | |
run: | | |
dotnet run -- \ | |
--manifest-folder="${{ github.workspace }}/manifests" \ | |
--output-folder="${{ github.workspace }}/output" \ | |
--work-folder="${{ github.workspace }}/work" \ | |
--static-folder="${{ github.workspace }}/Plogon/Plogon/static" \ | |
--artifact-folder="${{ github.workspace }}/artifacts" \ | |
--build-overrides-file="${{ github.workspace }}/manifests-master/overrides.toml" \ | |
--ci --mode=PullRequest | |
cat $GITHUB_STEP_SUMMARY | |
echo ::set-output name=summary::$(cat $GITHUB_STEP_SUMMARY) | |
echo ::set-output name=summary_json::$(awk '{printf "%s\\n", $0}' $GITHUB_STEP_SUMMARY) | |
echo ${{ steps.plogon_run.outputs.summary }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: plugin-artifact | |
path: artifacts | |
- uses: LouisBrunner/checks-action@v1.2.0 | |
if: always() | |
with: | |
token: ${{ steps.get-token.outputs.token }} | |
check_id: ${{ steps.register_check.outputs.check_id }} | |
conclusion: ${{ job.status }} | |
details_url: "https://github.com/goatcorp/DalamudPluginsD17/actions/runs/${{ github.run_id }}" | |
output: | | |
{"summary":"${{ steps.plogon_run.outputs.summary_json }}"} |