-
Notifications
You must be signed in to change notification settings - Fork 26
79 lines (72 loc) · 2.34 KB
/
test-ga-bump-upstream-template.yml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Test GA bump-upstream template
on:
push:
pull_request:
branches:
- master
env:
ENVIRONMENT: TEST
INITIAL_VERSION: "0.1.0"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- run: yarn install
- run: yarn build
# Simulate Github Actions run on an actual DAppNode package
- name: Setup a "template" mock package to test locally
run: node dist/dappnodesdk.js init --yes --force --dir template
- name: Add upstream repo and arg to manifest
run: |
cat <<EOT > ./template/dappnode_package.json
{
"name": "ipfs.dnp.dappnode.eth",
"version": "${{ env.INITIAL_VERSION }}",
"description": "ipfs.dnp.dappnode.eth description",
"type": "service",
"author": "runner",
"categories": ["Developer tools"],
"links": {
"homepage": "https://your-project-homepage-or-docs.io"
},
"license": "GPL-3.0",
"upstreamRepo": "ipfs/go-ipfs",
"upstreamArg": "UPSTREAM_VERSION",
"upstreamVersion": "v0.4.0"
}
EOT
- name: Add upstream arg to compose
run: |
cat <<EOT > ./template/docker-compose.yml
version: "3.5"
services:
ipfs.dnp.dappnode.eth:
build:
context: .
args:
UPSTREAM_VERSION: v0.4.0
image: "ipfs.dnp.dappnode.eth:${{ env.INITIAL_VERSION }}"
restart: unless-stopped
EOT
- name: Init a git repository at the template directory
run: |
cd template
git init
git config user.name "DAppNodeBot"
git config user.email "[email protected]"
git add .
git commit -m "Initial commit"
git remote add origin .
- name: Bump upstream version
run: |
cd template
node ../dist/dappnodesdk.js github-action bump-upstream --eth_provider=infura -f
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PINATA_API_KEY: ${{ secrets.PINATA_API_KEY }}
PINATA_SECRET_API_KEY: ${{ secrets.PINATA_SECRET_API_KEY }}