Skip to content

Commit

Permalink
add actions for automation
Browse files Browse the repository at this point in the history
  • Loading branch information
cornelcroi committed Jun 7, 2024
1 parent 550240e commit 43992c2
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/actions/github/release/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Create a release"

description: "Creates a release"

inputs:
github-token:
description: "GitHub token of a user with permission to create a release"
required: true

runs:
using: "composite"

steps:
- name: "Determine tag"
if: "${{ github.event_name }} == 'push' && ${{ github.ref_type }} == 'tag'"
run: "echo \"RELEASE_TAG=${GITHUB_REF#refs/tags/}\" >> $GITHUB_ENV"
shell: "bash"

- name: "Create release"
uses: "actions/[email protected]"
with:
github-token: "${{ inputs.github-token }}"
script: |
if (!process.env.RELEASE_TAG) {
core.setFailed("The environment variable RELEASE_TAG is not defined.")
return;
}
try {
const response = await github.rest.repos.createRelease({
draft: false,
generate_release_notes: true,
name: process.env.RELEASE_TAG,
owner: context.repo.owner,
prerelease: false,
repo: context.repo.repo,
tag_name: process.env.RELEASE_TAG,
});
core.exportVariable('RELEASE_HTML_URL', response.data.html_url);
core.exportVariable('RELEASE_ID', response.data.id);
core.exportVariable('RELEASE_UPLOAD_URL', response.data.upload_url);
} catch (error) {
core.setFailed(error.message);
}
33 changes: 33 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
publish-to-npm:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm run build
- run: cp cdk.json.built cdk.json
- run: npm pack
- run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Fix A record


## [1.1.10] - 2024-06-05
### Added

- Add option to submit a feature request


### Changed


### Fixed


0 comments on commit 43992c2

Please sign in to comment.