Skip to content

Commit c4e22c7

Browse files
Clinton WerthClinton Werth
authored andcommitted
add release yamls
1 parent 500e5b6 commit c4e22c7

File tree

6 files changed

+193
-4
lines changed

6 files changed

+193
-4
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: test and package sftp service plugin
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
push:
7+
paths:
8+
- .github/workflows/build_test.sftp.service.yaml
9+
- .github/workflows/config.yaml
10+
- plugins/sftp/service/**
11+
12+
jobs:
13+
14+
config:
15+
uses: ./.github/workflows/config.yaml
16+
17+
test:
18+
name: test plugin sftp.service
19+
needs: [ config ]
20+
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
node: ${{ fromJSON(needs.config.outputs.node_versions-all-json) }}
24+
steps:
25+
- name: checkout
26+
uses: actions/checkout@v4
27+
- name: setup node
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: ${{ matrix.node }}
31+
cache: npm
32+
cache-dependency-path: |
33+
plugins/sftp/service/package-lock.json
34+
- name: test with node ${{ matrix.node }}
35+
run: |
36+
cd plugins/sftp/service
37+
npm ci
38+
npm test
39+
40+
package:
41+
name: package plugin sftp.service
42+
needs: [ config, test ]
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: checkout
46+
uses: actions/checkout@v4
47+
- name: setup node
48+
uses: actions/setup-node@v4
49+
with:
50+
node-version: ${{ needs.config.outputs.node_versions-lts }}
51+
cache: npm
52+
cache-dependency-path: |
53+
plugins/sftp/service/package-lock.json
54+
- name: build
55+
run: |
56+
cd plugins/sftp/service
57+
npm ci
58+
npm run build
59+
- name: pack
60+
run: npm pack ./plugins/sftp/service
61+
- name: upload package
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: sftp.service-artifacts
65+
path: |
66+
ngageoint-mage.*.tgz
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: test and package sftp web plugin
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
push:
7+
paths:
8+
- .github/workflows/build_test.sftp.web.yaml
9+
- .github/workflows/config.yaml
10+
- plugins/sftp/web/**
11+
12+
jobs:
13+
14+
config:
15+
uses: ./.github/workflows/config.yaml
16+
17+
build:
18+
name: build plugin mage.sftp.web
19+
needs: config
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: checkout
23+
uses: actions/checkout@v4
24+
- name: setup node
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ needs.config.outputs.node_versions-lts }}
28+
cache: npm
29+
cache-dependency-path: plugins/sftp/web/package-lock.json
30+
- name: build
31+
run: |
32+
cd plugins/sftp/web
33+
npm ci
34+
npm run build
35+
env:
36+
NODE_OPTIONS: "--max_old_space_size=4096"
37+
- name: test
38+
run: |
39+
cd plugins/sftp/web
40+
npm run test-headless
41+
- name: pack
42+
run: |
43+
npm pack ./plugins/sftp/web/dist/main
44+
- name: upload packages
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: sftp.web-artifacts
48+
path: |
49+
ngageoint-mage.sftp.web-*.tgz
50+
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: release sftp plugin
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: The version you want to assign to the release
8+
type: string
9+
required: true
10+
11+
# TODO: possibly use release branches to perform the release process
12+
# push:
13+
# branches:
14+
# - release/*
15+
# - prerelease/*
16+
# TODO: possibly use release event to perform the release process
17+
# release:
18+
19+
jobs:
20+
21+
config:
22+
uses: ./.github/workflows/config.yaml
23+
24+
check_release_version:
25+
needs: [ config ]
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: checkout
29+
uses: actions/checkout@v4
30+
- name: setup node
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: ${{ needs.config.outputs.node_versions-lts }}
34+
- name: install json util
35+
run: npm i -g json
36+
- name: check service
37+
run: |
38+
[[ $(json version < ./plugins/sftp/service/package.json) = ${{ inputs.version }} ]] || exit 1
39+
- name: check web
40+
run: |
41+
[[ $(json version < ./plugins/sftp/web/package.json) = ${{ inputs.version }} ]] || exit 1
42+
43+
build_and_test-service:
44+
needs: [ check_release_version ]
45+
uses: ./.github/workflows/build_test.sftp.service.yaml
46+
47+
build_and_test-web:
48+
needs: [ check_release_version ]
49+
uses: ./.github/workflows/build_test.sftp.web.yaml
50+
51+
publish_packages:
52+
name: publish packages
53+
needs: [ config, build_and_test-service ]
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: setup node
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version: ${{ needs.config.outputs.node_versions-lts }}
60+
- name: install json util
61+
run: npm i -g json
62+
- name: download service packages
63+
uses: actions/download-artifact@v4
64+
with:
65+
name: sftp.service-artifacts
66+
- name: download web packages
67+
uses: actions/download-artifact@v4
68+
with:
69+
name: sftp.web-artifacts
70+
- name: publish to package registry
71+
run: |
72+
npm config set -- '//registry.npmjs.org/:_authToken' ${{ secrets.NPM_TOKEN }}
73+
npm publish --access public $(ls -1 ngageoint-mage.sftp.service-*.tgz)
74+
npm publish --access public $(ls -1 ngageoint-mage.sftp.web-*.tgz)

instance/config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ module.exports = {
3434
plugins: {
3535
servicePlugins: [
3636
'@ngageoint/mage.arcgis.service',
37-
3837
'@ngageoint/mage.sftp.service'
3938
],
4039
webUIPlugins: [

plugins/sftp/service/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ngageoint/mage.sftp.service",
3-
"version": "1.0.0",
3+
"version": "1.0.0-beta.1",
44
"description": "The SFTP service package is a MAGE server plugin that sends observations to and SFTP location on create and update.",
55
"main": "lib/index.js",
66
"scripts": {

plugins/sftp/web/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "@ngageoint/mage.sftp.workspace",
3-
"version": "1.0.0",
2+
"name": "@ngageoint/mage.sftp.web",
3+
"version": "1.0.0-beta.1",
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",

0 commit comments

Comments
 (0)