From 5ee5d2209aee7a24a992f0b7835c21b481dd50dc Mon Sep 17 00:00:00 2001 From: Bruce Markham <219281+brucificus@users.noreply.github.com> Date: Sun, 15 Mar 2020 20:44:27 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Adds=20Rudimentary=20Continuous?= =?UTF-8?q?=20Delivery=20Pipeline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .EditorConfig | 8 ++++ .github/workflows/pull_request_checks.yml | 42 +++++++++++++++++++ .github/workflows/release.yml | 50 +++++++++++++++++++++++ .gitignore | 1 + package.json | 3 +- release.config.js | 44 ++++++++++++++++++++ 6 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 .EditorConfig create mode 100644 .github/workflows/pull_request_checks.yml create mode 100644 .github/workflows/release.yml create mode 100644 release.config.js diff --git a/.EditorConfig b/.EditorConfig new file mode 100644 index 0000000..3feb15e --- /dev/null +++ b/.EditorConfig @@ -0,0 +1,8 @@ +root = true + +[*] +insert_final_newline = true +indent_style = space + +[*.js] +indent_size = 2 \ No newline at end of file diff --git a/.github/workflows/pull_request_checks.yml b/.github/workflows/pull_request_checks.yml new file mode 100644 index 0000000..703b021 --- /dev/null +++ b/.github/workflows/pull_request_checks.yml @@ -0,0 +1,42 @@ +name: Build & Test + +on: + pull_request: + branches: + - master + - alpha + +jobs: + build_and_test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Checkout submodules + uses: textbook/git-checkout-submodule-action@2.1.1 + + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + + - name: npm ci + run: | + npm ci + env: + CI: true + + - name: npm build & test + run: | + npm run build + npm run test + env: + CI: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..938167f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: Release + +on: + push: + branches: + - master + - alpha + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Checkout submodules + uses: textbook/git-checkout-submodule-action@2.1.1 + + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + + - name: npm ci + run: | + npm ci + env: + CI: true + + - name: npm build & test + run: | + npm run build + npm run test + env: + CI: true + + - name: npm semantic-release + run: | + npm run semantic-release + env: + CI: true + GH_TOKEN: ${{ secrets.GH_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore index cbda011..f1b384c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules antlr4ts_out lib +dist diff --git a/package.json b/package.json index 27f33cd..7c2314c 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "build": "npm run build.cpygrammars && npm run build.antlr4ts && npm run build.tsc", "prepublishOnly": "npm run build && npm run test", "postversion": "git push && git push --tags", - "semantic-release": "semantic-release" + "semantic-release": "semantic-release --debug", + "semantic-release-dry-run": "semantic-release --dry-run --debug" }, "repository": { "type": "git", diff --git a/release.config.js b/release.config.js new file mode 100644 index 0000000..c9a9138 --- /dev/null +++ b/release.config.js @@ -0,0 +1,44 @@ +module.exports = { + branches: [ + "+([0-9])?(.{+([0-9]),x}).x", + "master", + { name: "beta", prerelease: true }, + { name: "alpha", prerelease: true } + ], + plugins: [ + [ + "semantic-release-gitmoji", + { + releaseRules: { + major: ["💥"], + minor: ["✨", "🏗", "⚡"], + patch: ["🐛", "🚑", "🔒", "♻", "💚", "⬆", "⬇", "➕", "➖", "🔧", "📝", "🔥", "👷‍♂️", "🔨", "⏪", "🚚"] + } + } + ], + [ + "@semantic-release/npm", + { + npmPublish: true, + tarballDir: "./dist/" + } + ], + [ + "@semantic-release/git", + { + message: "🔖 ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ], + [ + "@semantic-release/github", + { + assets: [ + { + path: "./dist/*.tgz", + name: "vb6-antlr4-${nextRelease.version}.tgz" + } + ] + } + ] + ] +};