Skip to content

Update Plugin - CozurOfficial.AutoClicker - V2.0.0 " #98

Update Plugin - CozurOfficial.AutoClicker - V2.0.0 "

Update Plugin - CozurOfficial.AutoClicker - V2.0.0 " #98

name: Compile Extension
on:
pull_request_target:
branches: [ "main" ]
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
setup:
name: "Setup"
runs-on: ubuntu-latest
outputs:
extension-path: ${{ steps.extract-extension-path.outputs.path }}
steps:
- uses: actions-ecosystem/action-add-labels@1a9c3715c0037e96b97bb38cb4c4b56a1f1d4871
with:
labels: in-process
- uses: actions-ecosystem/[email protected]
with:
labels: |
author-actions-required
build-failed
invalid-manifest
moderator-review-required
tests-failed
- name: Checkout
uses: actions/[email protected]
with:
ref: "refs/pull/${{ github.event.pull_request.number }}/merge"
- name: Extract extension path
id: extract-extension-path
env:
GH_TOKEN: ${{ github.token }}
run: |
pr_paths=$(gh pr view ${{ github.event.pull_request.number }} --json files | jq '.files | map(select(.path != ".gitmodules"))')
files_count=$(jq '. | length' <<< ${pr_paths})
if [[ $files_count -gt 1 ]]
then
echo "Only one extension per pull-request is allowed!"
exit 1
elif [[ $files_count -eq 0 ]]
then
echo "No extension was found"
exit 1
fi
echo "path=$(jq -r '.[0].path' <<< ${pr_paths})" >> $GITHUB_OUTPUT
- name: Check extension path
run: echo "${{ steps.extract-extension-path.outputs.path }}"
- uses: actions-ecosystem/[email protected]
if: failure() && (steps.extract-extension-path.outcome == 'failure')
with:
labels: in-process
- uses: actions-ecosystem/action-add-labels@1a9c3715c0037e96b97bb38cb4c4b56a1f1d4871
if: failure() && (steps.extract-extension-path.outcome == 'failure')
with:
labels: author-actions-required
build:
name: "Build"
needs: [ setup ]
runs-on: ubuntu-latest
outputs:
artifact-name: ${{ steps.build_extension.outputs.artifact-name }}
artifact-path: ${{ steps.build_extension.outputs.artifact-path }}
manifest: ${{ steps.build_extension.outputs.manifest }}
steps:
- name: Checkout
uses: actions/[email protected]
with:
ref: "refs/pull/${{ github.event.pull_request.number }}/merge"
- name: Init Submodule
run: git submodule update --init --recursive ./${{ needs.setup.outputs.extension-path }}
- name: Build Extension
id: build_extension
uses: Macro-Deck-App/Actions/build-extension@main
with:
extension-path: ${{ needs.setup.outputs.extension-path }}
artifact-name: ${{ github.event.pull_request.number }}
- uses: actions-ecosystem/[email protected]
if: failure() && (steps.build_extension.outcome == 'failure')
with:
labels: in-process
- uses: actions-ecosystem/action-add-labels@1a9c3715c0037e96b97bb38cb4c4b56a1f1d4871
if: failure() && (steps.build_extension.outcome == 'failure')
with:
labels: |
author-actions-required
build-failed
- uses: actions-ecosystem/action-add-labels@1a9c3715c0037e96b97bb38cb4c4b56a1f1d4871
if: success()
with:
labels: moderator-review-required
- uses: actions-ecosystem/[email protected]
if: success()
with:
labels: |
in-process
deploy:
name: "Deploy"
environment: production
needs: [ build ]
runs-on: ubuntu-latest
steps:
- uses: actions-ecosystem/action-add-labels@1a9c3715c0037e96b97bb38cb4c4b56a1f1d4871
with:
labels: approved
- uses: actions-ecosystem/[email protected]
with:
labels: moderator-review-required
- name: Download a Build Artifact
uses: actions/[email protected]
with:
name: ${{ github.event.pull_request.number }}
- name: Upload build files
id: upload-build-files
env:
AUTH_TOKEN: ${{ secrets.MACRO_DECK_API_TOKEN }}
uses: Macro-Deck-App/Actions/upload-extension@main
with:
extension-path: "${{ github.event.pull_request.number }}.zip"
api-token: ${{ env.AUTH_TOKEN }}
- name: Notify
uses: Macro-Deck-App/Actions/notify-extension@main
with:
upload-response: ${{ steps.upload-build-files.outputs.response }}
bot-token: ${{ secrets.BOT_TOKEN }}
- name: Merge Pull Request
uses: "pascalgn/[email protected]"
env:
MERGE_LABELS: ""
PULL_REQUEST: ${{ steps.create-pr.outputs.pull-request-number}}
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"