diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..b90a48f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,110 @@ +name: Functionly build and publish + +on: + workflow_dispatch: + +jobs: + dev: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '8' + - name: Install dependencies + run: npm i --no-save -q + - name: Setup .npmrc for npmjs + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Auto Increment Version, and Publish to npmjs + run: | + git config --global user.email "jaystack-ci@jaystack.com" + git config --global user.name "jaystack-ci" + git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} + npm version patch -m "Auto-increment version: %s" --force + npm publish --tag dev + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Git operations + run: | + git tag -f dev + git push -f --tags + git push + stage: + needs: dev + runs-on: ubuntu-latest + environment: stage + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + with: + ref: 'refs/tags/dev' + + - name: Configure npm + run: echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Extract package version + id: package_version + run: echo "::set-output name=VERSION::$(jq -r .version package.json)" + shell: bash + + - name: Configure Git + run: | + git config --global user.email "jaystack-ci@jaystack.com" + git config --global user.name "jaystack-ci" + git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} + + - name: Create and push git tag + run: | + git tag -f stage + git push -f --tags + + - name: Publish to npm + run: npm dist-tag add functionly@${{ steps.package_version.outputs.VERSION }} stage + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + live: + needs: stage + runs-on: ubuntu-latest + environment: live + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + with: + ref: 'refs/tags/stage' + + - name: Configure npm + run: echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Extract package version + id: package_version + run: echo "::set-output name=VERSION::$(jq -r .version package.json)" + shell: bash + + - name: Configure Git + run: | + git config --global user.email "jaystack-ci@jaystack.com" + git config --global user.name "jaystack-ci" + git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} + + - name: Create and push git tag + run: | + git tag -f latest + git push -f --tags + + - name: Publish to npm + run: npm dist-tag add functionly@${{ steps.package_version.outputs.VERSION }} latest + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + diff --git a/package-lock.json b/package-lock.json index 2b16a08..a9a6296 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "functionly", - "version": "0.5.0", + "version": "0.6.3", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 2a09cf8..7f3b876 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "functionly", - "version": "0.5.0", + "version": "0.6.3", "description": "", "main": "lib/src/index", "types": "lib/src/index.d.ts", diff --git a/src/cli/context/steppes/codeCompile.ts b/src/cli/context/steppes/codeCompile.ts index 347f261..f81d81f 100644 --- a/src/cli/context/steppes/codeCompile.ts +++ b/src/cli/context/steppes/codeCompile.ts @@ -110,9 +110,6 @@ export const bundleConfig = ExecuteStep.register('WebpackBundleConfig', async (c }) const externals = {} - if (context.deployTarget === 'aws') { - externals['aws-sdk'] = 'commonjs aws-sdk' - } let compile = {} if (projectConfig.compile) { @@ -183,4 +180,4 @@ export const watchConfig = ExecuteStep.register('WebpackWatchConfig', (context) ignored: /dist/ } } -}) \ No newline at end of file +})