diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..b2040e9 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,31 @@ +name: Publish + +on: + release: + types: [published, edited] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.event.release.tag_name }} + - name: Use node.js 16.x + uses: actions/setup-node@v3 + with: + node-version: 16 + - name: NPM Install + run: npm ci + - name: Check Format + run: npm run format:check + - name: Lint + run: npm run lint + - name: Test + run: npm run test + - uses: JasonEtco/build-and-tag-action@v2 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + tag_name: ${{ github.event.release.tag_name }} diff --git a/README.md b/README.md index 169c611..1bff848 100644 --- a/README.md +++ b/README.md @@ -275,6 +275,12 @@ For this reason, and to simplify what we expect to be the most common use-cases, we chose to start with the simplest possible configuration. If you find that these options don't meet your needs, please open an issue to let us know. +## Release Process + +By creating a new Release a workflow is triggered creating a new commit which only contains `dist` and the `action.yml`. The necessary tags, i.e. for the release v1.0.7, the tag v1.0.7 is created and the v1.0 and v1 tags are updated. + +For the tagging and building the [build-and-tag](https://github.com/JasonEtco/build-and-tag-action) action by [Jason Etcovitch](https://github.com/JasonEtco) is used. It expects to have the main attribute and a build script to be set in the `package.json`. It then builds the code with the ncc compiler and creates the new tag/ updates existing tags for minor and major versions automatically. + ## License This SDK is distributed under the diff --git a/local.js b/local.js old mode 100755 new mode 100644 diff --git a/package.json b/package.json index 6199fde..f27fac5 100644 --- a/package.json +++ b/package.json @@ -2,11 +2,13 @@ "name": "@aws-actions/codebuild-run-build", "version": "1.0.4", "description": "Execute CodeBuild::startBuild for the current repo.", - "main": "index.js", + "main": "dist/index.js", "scripts": { "lint": "prettier -c *.js *.json *.md test/*.js; eslint **.js test/**.js", "format": "prettier --write -c *.js *.json *.md test/*.js; eslint --fix **.js test/**.js", + "format:check": "prettier --check -c *.js *.json *.md test/*.js; eslint --fix **.js test/**.js", "package": "ncc build index.js -o dist", + "build": "ncc build index.js -o dist", "test": "mocha" }, "author": "aws-crypto-tools-team@amazon.com",