Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: setup release automation and proper git tags #5

Merged
merged 1 commit into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: PR

on:
pull_request:
types:
- edited
- opened
- reopened
- synchronize

jobs:
title:
name: Check Title
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Check
uses: stordco/actions-pr-title@v1.0.0
with:
regex: '^(feat!|fix!|fix|feat|chore|(fix|feat|chore)\(\w.*\)):\s(\[\w{1,8}-\d{1,8}\]|.*).*'
hint: |
You can pass the following formats:

fix: [OR-123] some title of the PR
fix(scope): [OR-123] some title of the PR
feat: [OR-1234] some title of the PR
chore: update some action
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Release

on:
push:
branches:
- main

jobs:
please:
name: Please
runs-on: ubuntu-latest

steps:
- name: Release
uses: google-github-actions/release-please-action@v3
with:
release-type: node
package-name: actions-elixir
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
extra-files: README.md

- if: ${{ steps.release.outputs.release_created }}
name: Checkout
uses: actions/checkout@v3
with:
ref: my-branch
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
persist-credentials: true

- if: ${{ steps.release.outputs.release_created }}
name: Tag
run: |
git config user.name stord-engineering-account
git config user.email engineering@stord.com

git tag -d v${{ steps.release.outputs.major }} || true
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git push origin :v${{ steps.release.outputs.major }} || true
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true

git tag -a v${{ steps.release.outputs.major }} -m "chore(main): release ${{ steps.release.outputs.major }}"
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "chore(main): release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
git push origin v${{ steps.release.outputs.major }}
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"setup": "0.1.2"
}
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
# actions-elixir

GitHub Actions for simplifying Elixir operations

# Overview
## Overview

stordco/actions-elixir implements composite actions for simplifying Elixir
operations - setup, dependency retrieval, etc.

# `stordco/actions-elixir/setup` Action
## `stordco/actions-elixir/setup` Action

## Usage
### Usage

<!-- {x-release-please-start-version} -->
```yaml
- uses: stordco/actions-elixir/setup@v0.1
with:
elixir_version: 1.13.4
elixir_version: "1.13"
github_personal_access_token: ${{ secrets.GITHUB_PERSONAL_ACCESS_TOKEN }}
otp_version: 25.0
otp_version: "25.0"
```
<!-- {x-release-please-end} -->

### Inputs

## Inputs
- `cache_path` - (Optional) Override default paths to cache
- `elixir_version` - Specify Elixir version
- `github_personal_access_token` - (Optional) Usually `secrets.GITHUB_PERSONAL_ACCESS_TOKEN`, to setup git for mix dep retrieval
Expand Down
7 changes: 7 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"separate-pull-requests": false,
"draft-pull-request": true,
"packages": {
"setup": {}
}
}