-
Notifications
You must be signed in to change notification settings - Fork 8
64 lines (53 loc) · 2.48 KB
/
toolbox-publish.yml
File metadata and controls
64 lines (53 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: "Toolbox Publish"
on:
workflow_run:
workflows: ["Toolbox Build"]
types:
- completed
jobs:
publish-graphql-toolbox:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- name: Download built Toolbox
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "graphqltoolbox"
})[0];
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{ github.workspace }}/graphqltoolbox.zip', Buffer.from(download.data));
- run: unzip graphqltoolbox.zip
- id: get-pr-number
run: |
number=$(<prnumber)
case "$number" in ''|*[!0-9]*) echo "Provided PR number is not an integer"; exit 1 ;; esac
echo "pr-number=$number" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: ./.github/actions/reusable-setup/
- name: Publish the Toolbox to surge.sh
run: |
npm install -g surge
surge . neo4j-graphql-toolbox-${{ steps.get-pr-number.outputs.pr-number }}.surge.sh --token ${{ secrets.SURGE_TOKEN }}
- name: Comment on PR
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
with:
number: ${{ steps.get-pr-number.outputs.pr-number }}
header: toolbox
message: |
Made some changes to the Neo4j GraphQL Toolbox? Or made some changes to the core library perhaps?
Check out your changes at https://neo4j-graphql-toolbox-${{ steps.get-pr-number.outputs.pr-number }}.surge.sh
Use for instance a local dbms hosted on [Neo4j Desktop](https://neo4j.com/download/) or a cloud-hosted [Aura Free](https://neo4j.com/cloud/aura-free/) dbms.
GITHUB_TOKEN: ${{ secrets.NEO4J_TEAM_GRAPHQL_PERSONAL_ACCESS_TOKEN }}