Skip to content

Commit a81aa48

Browse files
committed
feat(Python): package for each python version
1 parent de876f8 commit a81aa48

File tree

4 files changed

+16
-78
lines changed

4 files changed

+16
-78
lines changed

.github/workflows/CD.yml

Lines changed: 11 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,37 @@ on:
77
jobs:
88
build-linux:
99
runs-on: ubuntu-18.04
10-
container: ${{ matrix.config.container }}
1110
strategy:
1211
matrix:
13-
config:
14-
- {container: "geodesolutions/ubuntu", system: ubuntu}
15-
- {container: "geodesolutions/centos", system: rhel}
12+
system: [ubuntu, darwin, win64]
13+
python: [3.6, 3.7, 3.8]
14+
exclude:
15+
- system: win64
16+
python: 3.8
17+
include:
18+
- system: rhel
19+
python: 2.7
1620

1721
steps:
1822
- uses: actions/checkout@v1
1923
- name: Cache node modules
2024
uses: actions/[email protected]
2125
with:
2226
path: node_modules
23-
key: node-${{ matrix.config.system }}-${{ hashFiles('package-lock.json') }}
27+
key: node-${{ hashFiles('package-lock.json') }}
2428
- name: Generate package
2529
id: package
2630
run: |
2731
version="${GITHUB_REF##*/*/}"
2832
echo ::set-output name=version::$version
2933
npm install
30-
npm run build -- $version ${{ matrix.config.system }}
34+
npm run build -- $version ${{ matrix.python }}-${{ matrix.system }}
3135
env:
3236
TOKEN: ${{ secrets.TOKEN }}
3337
- name: Upload
3438
uses: softprops/action-gh-release@v1
3539
with:
36-
files: "GeodePackage-${{ steps.package.outputs.version }}-${{ matrix.config.system }}.zip"
40+
files: "GeodePackage-${{ steps.package.outputs.version }}-${{ matrix.system }}.zip"
3741
env:
3842
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3943
- name: Notify slack
@@ -44,72 +48,3 @@ jobs:
4448
env:
4549
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4650
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
47-
48-
build-mac:
49-
runs-on: macos-latest
50-
51-
steps:
52-
- uses: actions/checkout@v1
53-
- name: Cache node modules
54-
uses: actions/[email protected]
55-
with:
56-
path: node_modules
57-
key: node-darwin-${{ hashFiles('package-lock.json') }}
58-
- name: Generate package
59-
id: package
60-
run: |
61-
version="${GITHUB_REF##*/*/}"
62-
echo ::set-output name=version::$version
63-
npm install
64-
npm run build -- $version darwin
65-
env:
66-
TOKEN: ${{ secrets.TOKEN }}
67-
- name: Upload
68-
uses: softprops/action-gh-release@v1
69-
with:
70-
files: "GeodePackage-${{ steps.package.outputs.version }}-darwin.zip"
71-
env:
72-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73-
- name: Notify slack
74-
if: failure() && github.ref == 'refs/heads/master'
75-
uses: 8398a7/action-slack@v2
76-
with:
77-
status: failure
78-
env:
79-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
81-
82-
build-windows:
83-
runs-on: windows-2016
84-
85-
steps:
86-
- uses: actions/checkout@v1
87-
- name: Cache node modules
88-
uses: actions/[email protected]
89-
with:
90-
path: node_modules
91-
key: node-win64-${{ hashFiles('package-lock.json') }}
92-
- name: Generate package
93-
id: package
94-
run: |
95-
$version = ${env:GITHUB_REF} -replace 'refs\/tags\/', ''
96-
echo "::set-output name=version::$version"
97-
npm install
98-
npm run build -- $version win64
99-
env:
100-
TOKEN: ${{ secrets.TOKEN }}
101-
- name: Upload
102-
uses: softprops/action-gh-release@v1
103-
with:
104-
files: "GeodePackage-${{ steps.package.outputs.version }}-win64.zip"
105-
env:
106-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107-
- name: Notify slack
108-
if: failure() && github.ref == 'refs/heads/master'
109-
uses: 8398a7/action-slack@v2
110-
with:
111-
status: failure
112-
env:
113-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
115-

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: actions/[email protected]
2525
with:
2626
path: node_modules
27-
key: node-${{ matrix.system }}-${{ hashFiles('package-lock.json') }}
27+
key: node-${{ hashFiles('package-lock.json') }}
2828
- name: Compile
2929
run: |
3030
npm install

package.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ var octokit = new Octokit({auth: process.env.TOKEN});
4040
function getRelease(repo, tag, isModule) {
4141
const outputDirectory = isModule ? path.join(dir, "modules") : dir;
4242
return new Promise((resolve, reject) => {
43+
console.log(repo, tag);
4344
octokit.repos.getReleaseByTag({owner, repo, tag}).then(release => {
4445
const release_id = release.data.id;
46+
console.log(release);
4547
octokit.repos.listAssetsForRelease({owner, repo, release_id})
4648
.then(assets => {
4749
const asset = assets.data.find(asset => asset.name.includes(process.argv[3]));
@@ -71,6 +73,7 @@ function getRelease(repo, tag, isModule) {
7173
});
7274
});
7375
}).catch((error)=>{
76+
console.log(error);
7477
reject(error);
7578
});
7679
});

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"geode": "v1.2.1",
33
"modules": {
4-
"OpenGeode": "v1.1.1"
4+
"OpenGeode": "v1.1.0"
55
}
66

77
}

0 commit comments

Comments
 (0)