|
| 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) |
0 commit comments