Skip to content

v3.3.1-rc1

v3.3.1-rc1 #63

Workflow file for this run

name: Release
on:
release:
types:
- published
env:
SAR_BUCKET_NAME : ${{ secrets.SAR_BUCKET_NAME }}
AWS_REGION : "eu-west-1"
permissions:
id-token: write
contents: read
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
registry-url: "https://registry.npmjs.org"
- name: Use npm 8
run: npm install -g npm@^8
- name: Test NPM login
run: npm whoami
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/setup-python@v3
with:
python-version: "3.8"
- uses: aws-actions/setup-sam@v2
- name: Install esbuild
run: npm install esbuild -g
- name: Install dependencies
run: npm ci
- name: Build TypeScript
run: npm run build
- name: NPM security audit
run: npm run audit
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.SAR_DEPLOYMENT_IAM_ROLE }}
role-session-name: github-action-sar-deploy-session
aws-region: ${{ env.AWS_REGION }}
- name: NPM publish
run: |
cp README.md serverless-plugin
[[ "${{ github.event.release.prerelease }}" = true ]] && export NPM_PUBLISH_ARGS="--tag next" || export NPM_PUBLISH_ARGS=""
npm publish ${NPM_PUBLISH_ARGS} --workspace slic-watch-core --workspace serverless-slic-watch-plugin
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: SAR publish
if: ${{ github.event.release.prerelease == false }}
run: |
sam build --base-dir . --template-file cf-macro/template.yaml
sam package --output-template-file packaged.yaml --s3-bucket ${SAR_BUCKET_NAME}
sam publish --template packaged.yaml --region ${AWS_REGION} --semantic-version $(cat package.json | jq -r '.version')