Release #89
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: workflow_dispatch | |
# Necessary to deploy to AWS using OIDC | |
# https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
# To allow creating the GitHub release | |
contents: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# So that we can create git commits | |
fetch-depth: 0 | |
# Set git credentials (https://github.com/actions/checkout/issues/13#issuecomment-724415212) | |
- name: Set Git credentials | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
- name: Set AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
role-to-assume: arn:aws:iam::534081306603:role/bref-layer-js-github-actions | |
role-session-name: bref-layer-js-github-actions | |
aws-region: us-east-1 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
registry-url: https://registry.npmjs.org/ | |
- run: npm install | |
- run: npm run update | |
- run: git commit -am "Update layer versions" | |
- name: Bump the version | |
run: npm version patch | |
- name: Push the new commit and git tag | |
run: git push origin && git push origin --tags | |
- run: npm publish --access=public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.npm_token}} | |
- name: Retrieve the new NPM version | |
id: npm-version | |
uses: martinbeentjes/npm-get-version-action@main | |
- name: Create a GitHub release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: v${{steps.npm-version.outputs.current-version}} |