You've already forked library-registry
mirror of
https://github.com/arduino/library-registry.git
synced 2025-07-28 02:41:51 +03:00
Move submission parser tool to dedicated repository
This commit is contained in:
45
.github/workflows/check-go.yml
vendored
45
.github/workflows/check-go.yml
vendored
@ -1,45 +0,0 @@
|
||||
name: Check Go code
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- ".github/workflows/check-go.yml"
|
||||
- "Taskfile.yml"
|
||||
- "manager/**"
|
||||
pull_request:
|
||||
paths:
|
||||
- ".github/workflows/check-go.yml"
|
||||
- "Taskfile.yml"
|
||||
- "manager/**"
|
||||
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch
|
||||
workflow_dispatch:
|
||||
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#repository_dispatch
|
||||
repository_dispatch:
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout local repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: "1.14"
|
||||
|
||||
- name: Install Taskfile
|
||||
uses: arduino/actions/setup-taskfile@master
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
version: 3.x
|
||||
|
||||
- name: Lint
|
||||
run: task go:lint
|
||||
|
||||
- name: Run tests
|
||||
run: task go:test
|
||||
|
||||
- name: Check formatting
|
||||
run: task go:check-formatting
|
29
.github/workflows/manage-prs.yml
vendored
29
.github/workflows/manage-prs.yml
vendored
@ -1,5 +1,8 @@
|
||||
name: Manage PRs
|
||||
|
||||
env:
|
||||
SUBMISSION_PARSER_VERSION: 1.0.0-rc2 # See: https://github.com/arduino/library-manager-submission-parser/releases
|
||||
|
||||
on:
|
||||
# pull_request_target trigger is used instead of pull_request so the token will have the write permissions needed to comment and merge.
|
||||
# Note that this means the version of the workflow from the PR base ref will be used as opposed to the head ref, as is the case with pull_request triggered workflows.
|
||||
@ -25,7 +28,6 @@ jobs:
|
||||
contains(github.event.comment.body, 'ArduinoBot')
|
||||
)
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Dummy step to make job valid
|
||||
run: ""
|
||||
@ -77,27 +79,15 @@ jobs:
|
||||
index-entry: ${{ steps.parse-request.outputs.index-entry }}
|
||||
|
||||
steps:
|
||||
- name: Set environment variables
|
||||
run: |
|
||||
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
|
||||
echo "MANAGER_PATH=${{ runner.temp }}/manager" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Checkout local repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v2
|
||||
|
||||
- name: Install Taskfile
|
||||
uses: arduino/actions/setup-taskfile@master
|
||||
- name: Download submission parser
|
||||
id: download-parser
|
||||
uses: carlosperate/download-file-action@v1.0.3
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
version: 3.x
|
||||
|
||||
- name: Build manager
|
||||
env:
|
||||
GO_BUILD_FLAGS: -o $MANAGER_PATH
|
||||
run: task go:build
|
||||
file-url: https://github.com/arduino/library-registry-submission-parser/releases/download/${{ env.SUBMISSION_PARSER_VERSION }}/parser
|
||||
location: ${{ runner.temp }}
|
||||
|
||||
- name: Download diff
|
||||
uses: actions/download-artifact@v2
|
||||
@ -108,7 +98,8 @@ jobs:
|
||||
- name: Parse request
|
||||
id: parse-request
|
||||
run: |
|
||||
REQUEST="$("$MANAGER_PATH" --diffpath="${{ needs.diff.outputs.path }}/${{ needs.diff.outputs.filename }}" --repopath="${{ github.workspace }}" --listname="repositories.txt")"
|
||||
chmod u+x "${{ steps.download-parser.outputs.file-path }}"
|
||||
REQUEST="$("${{ steps.download-parser.outputs.file-path }}" --diffpath="${{ needs.diff.outputs.path }}/${{ needs.diff.outputs.filename }}" --repopath="${{ github.workspace }}" --listname="repositories.txt")"
|
||||
# Due to limitations of the GitHub Actions workflow system, dedicated outputs must be created for use in certain workflow fields.
|
||||
echo "::set-output name=type::$(echo "$REQUEST" | jq -r -c '.type')"
|
||||
echo "::set-output name=submissions::$(echo "$REQUEST" | jq -c '.submissions')"
|
||||
|
Reference in New Issue
Block a user