Skip to content

Commit

Permalink
release: v1.0.0 (#1)
Browse files Browse the repository at this point in the history
* 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
jortfal authored Apr 18, 2021
1 parent e707a5c commit 7905a80
Show file tree
Hide file tree
Showing 8 changed files with 10,132 additions and 29 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
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
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
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
25 changes: 25 additions & 0 deletions .gitpod.yml
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==
27 changes: 0 additions & 27 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -172,30 +172,3 @@
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

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.
55 changes: 53 additions & 2 deletions README.md
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.
49 changes: 49 additions & 0 deletions index.js
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}`,
},
],
],
};
Loading

0 comments on commit 7905a80

Please sign in to comment.