-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: add gitpod config * feat: add package config * chore: add package lock * feat: add shareable configuration * docs: add license * docs: add readme * ci: add test workflow * style: prettier code formatter * ci(test): improve workflow * ci(release): add release workflow
- Loading branch information
Showing
8 changed files
with
10,132 additions
and
29 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
release: | ||
name: release | ||
runs-on: ubuntu-latest | ||
environment: production | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
- name: Setup NPM | ||
uses: bahmutov/npm-install@v1 | ||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: npx semantic-release |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- release/* | ||
|
||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
node-version: | ||
- 10.18.0 | ||
- 12 | ||
- 14 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- run: git config --global user.name github-actions | ||
- run: git config --global user.email [email protected] | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Ensure dependencies are compatible with the version of node | ||
run: echo 'engine-strict=true' >> .npmrc | ||
- name: Setup NPM | ||
uses: bahmutov/npm-install@v1 | ||
- name: Run tests | ||
run: npm run test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# image: | ||
# file: .gitpod.Containerfile | ||
|
||
# List the ports you want to expose and what to do when they are served. See https://www.gitpod.io/docs/config-ports/ | ||
# ports: | ||
# - port: 3000 | ||
# onOpen: open-preview | ||
# List the start up tasks. You can start them in parallel in multiple terminals. See https://www.gitpod.io/docs/config-start-tasks/ | ||
# tasks: | ||
# - init: echo 'init script' # runs during prebuild | ||
# command: echo 'start script' | ||
tasks: | ||
- name: Set up Git Config | ||
openIn: bottom | ||
command: git config --global user.name "jortfal" && | ||
git config --global user.email "[email protected]" && | ||
git config --global commit.gpgsign true && | ||
git config --global user.signingkey C62738C0CBE3CDCA && | ||
touch private.gpg && | ||
echo 'WARNING!!! Do not forget to import the private gpg key ;)' && | ||
echo 'use "gpg --import private.gpg" to import private key ' | ||
|
||
vscode: | ||
extensions: | ||
- [email protected]:GR9Y7wA3m2/LsuZxLaCFtg== |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,53 @@ | ||
# semantic-release-terraform-config | ||
semantic-release shareable config to continuous integration for terraform modules | ||
# @jortfal/semantic-release-terraform-config | ||
|
||
[**semantic-release**](https://github.com/semantic-release/semantic-release) shareable config to create release of [Terraform](https://www.terraform.io/) Modules | ||
|
||
![GitHub release (latest by date)](https://img.shields.io/github/v/release/jortfal/semantic-release-terraform-config) | ||
![GitHub Release Date](https://img.shields.io/github/release-date/jortfal/semantic-release-terraform-config) | ||
![GitHub license](https://img.shields.io/github/license/jortfal/semantic-release-terraform-config) | ||
![Maintenance](https://img.shields.io/maintenance/yes/2021?color=green) | ||
![Maintainer](https://img.shields.io/badge/maintainer-jortfal-green) | ||
[![Build Status](https://github.com/jortfal/semantic-release-terraform-config/workflows/Test/badge.svg)](https://github.com/jortfal/semantic-release-terraform-config/actions?query=workflow%3ATest+branch%3Amaster) [![npm latest version](https://img.shields.io/npm/v/jortfal/semantic-release-terraform-config/latest.svg)](https://www.npmjs.com/package/jortfal/semantic-release-terraform-config) | ||
|
||
## Plugins | ||
|
||
This shareable configuration use the following plugins: | ||
|
||
- [`@semantic-release/commit-analyzer`](https://github.com/semantic-release/commit-analyzer) | ||
- [`@semantic-release/release-notes-generator`](https://github.com/semantic-release/release-notes-generator) | ||
- [`@semantic-release/github`](https://github.com/semantic-release/github) | ||
- [`@semantic-release/changelog`](https://github.com/semantic-release/changelog) | ||
- [`@google/semantic-release-replace-plugin`](https://github.com/google/semantic-release-replace-plugin) | ||
- [`@semantic-release/git`](https://github.com/semantic-release/git) | ||
|
||
## Install | ||
|
||
```bash | ||
$ npm install --save-dev semantic-release @jortfal/semantic-release-terraform-config | ||
``` | ||
|
||
## Usage | ||
|
||
The shareable config can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration): | ||
|
||
```json | ||
{ | ||
"extends": "@jortfal/semantic-release-terraform-config" | ||
} | ||
``` | ||
|
||
## Configuration | ||
|
||
See each [plugin](#plugins) documentation for required installation and configuration steps. | ||
|
||
### Overwritten options | ||
|
||
This following options are set by this shareable config: | ||
|
||
| Option | Value | | ||
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | | ||
|[`replacements`](https://github.com/google/semantic-release-replace-plugin#usage)| {"files": ["locals.tf"], "from": "\"Terraform Module Version\" = \".*\"", "to": "\"Terraform Module Version\" = \"${nextRelease.version}\""} | | ||
| [`assets`](https://github.com/semantic-release/git#assets) | ["locals.tf", "CHANGELOG.md"] | | ||
| [`message`](https://github.com/semantic-release/git#message) | chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes} | | ||
|
||
**NOTE**: other options use their default values. See each [plugin](#plugins) documentation for available options. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
Copyright 2021 @jortfal | José Mnauel Ortega Falcón | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
module.exports = { | ||
plugins: [ | ||
'@semantic-release/commit-analyzer', | ||
'@semantic-release/release-notes-generator', | ||
'@semantic-release/github', | ||
'@semantic-release/changelog', | ||
[ | ||
'@google/semantic-release-replace-plugin', | ||
{ | ||
replacements: [ | ||
{ | ||
files: ['locals.tf'], | ||
from: `"Terraform Module Version" = ".*"`, | ||
to: `"Terraform Module Version" = "\${nextRelease.version}"`, | ||
results: [ | ||
{ | ||
file: 'locals.tf', | ||
hasChanged: true, | ||
numMatches: 1, | ||
numReplacements: 1, | ||
}, | ||
], | ||
countMatches: true, | ||
}, | ||
], | ||
}, | ||
], | ||
[ | ||
'@semantic-release/git', | ||
{ | ||
assets: ['locals.tf', 'CHANGELOG.md'], | ||
message: `chore(release): \${nextRelease.version} [skip ci]\n\n\${nextRelease.notes}`, | ||
}, | ||
], | ||
], | ||
}; |
Oops, something went wrong.