-
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.
- Loading branch information
Showing
16 changed files
with
855 additions
and
0 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,57 @@ | ||
--- | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
Test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
repository: | ||
- ua_parser | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: true | ||
repository: ${{ format('beam-community/{0}', matrix.repository) }} | ||
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Sync | ||
uses: stordco/actions-sync@v1 | ||
with: | ||
pr-enabled: false | ||
sync-auth: doomspork:${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
sync-repository: github.com/beam-community/common-config.git | ||
sync-tree: ${{ github.event.pull_request.head.sha || 'main' }} | ||
|
||
- name: Clean | ||
run: | | ||
rm -rf _build | ||
rm -rf .git | ||
rm -rf deps | ||
rm -rf node_modules | ||
- name: Archive | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Test ${{ matrix.repository }} | ||
path: ${{ github.workspace }}/**/* | ||
retention-days: 1 |
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,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/[email protected] | ||
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 |
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,47 @@ | ||
--- | ||
name: Publish | ||
|
||
on: | ||
release: | ||
types: | ||
- released | ||
- prereleased | ||
workflow_dispatch: {} | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
packages: write | ||
|
||
jobs: | ||
Sync: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Sync Repositories | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
script: | | ||
const { data } = await github.rest.search.code({ | ||
q: 'Common Config org:beam-community path:.github/workflows/', | ||
per_page: 100, | ||
}) | ||
const repositories = data.items | ||
.map((i) => i.repository) | ||
.filter((repo, index, list) => { | ||
return list.findIndex((r) => r.id === repo.id) === index; | ||
}); | ||
core.info(`Found ${repositories.length} repositories`); | ||
for (const repository of repositories) { | ||
core.info(`Dispatching workflow for ${repository.full_name}`); | ||
await github.rest.repos.createDispatchEvent({ | ||
owner: repository.owner.login, | ||
repo: repository.name, | ||
event_type: 'common-config' | ||
}); | ||
} |
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,54 @@ | ||
--- | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
Please: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
steps: | ||
- id: release | ||
name: Release | ||
uses: google-github-actions/release-please-action@v3 | ||
with: | ||
command: manifest | ||
config-file: .release-please-config.json | ||
manifest-file: .release-please-manifest.json | ||
release-type: simple | ||
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
|
||
- if: ${{ steps.release.outputs.release_created }} | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ steps.release.outputs.tag_name }} | ||
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
persist-credentials: true | ||
|
||
- if: ${{ steps.release.outputs.release_created }} | ||
name: Tag | ||
run: | | ||
git config user.name doomspork | ||
git config user.email [email protected] | ||
git tag -d latest || true | ||
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 :latest || 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 latest -m "chore(main): release latest" | ||
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 latest | ||
git push origin v${{ steps.release.outputs.major }} | ||
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} |
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,84 @@ | ||
# Created by https://www.toptal.com/developers/gitignore/api/vim,macos,mdbook,visualstudiocode | ||
# Edit at https://www.toptal.com/developers/gitignore?templates=vim,macos,mdbook,visualstudiocode | ||
|
||
### macOS ### | ||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
### macOS Patch ### | ||
# iCloud generated files | ||
*.icloud | ||
|
||
### MdBook ### | ||
book | ||
|
||
|
||
### Vim ### | ||
# Swap | ||
[._]*.s[a-v][a-z] | ||
!*.svg # comment out if you don't need vector files | ||
[._]*.sw[a-p] | ||
[._]s[a-rt-v][a-z] | ||
[._]ss[a-gi-z] | ||
[._]sw[a-p] | ||
|
||
# Session | ||
Session.vim | ||
Sessionx.vim | ||
|
||
# Temporary | ||
.netrwhist | ||
*~ | ||
# Auto-generated tag files | ||
tags | ||
# Persistent undo | ||
[._]*.un~ | ||
|
||
### VisualStudioCode ### | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
!.vscode/*.code-snippets | ||
|
||
# Local History for Visual Studio Code | ||
.history/ | ||
|
||
# Built Visual Studio Code Extensions | ||
*.vsix | ||
|
||
### VisualStudioCode Patch ### | ||
# Ignore all local history of files | ||
.history | ||
.ionide | ||
|
||
# End of https://www.toptal.com/developers/gitignore/api/vim,macos,mdbook,visualstudiocode | ||
|
||
test/ci/* | ||
!test/ci/.gitkeep |
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,38 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", | ||
"changelog-sections": [ | ||
{ | ||
"type": "feat", | ||
"section": "Features", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "fix", | ||
"section": "Bug Fixes", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "chore", | ||
"section": "Miscellaneous", | ||
"hidden": false | ||
} | ||
], | ||
"draft": false, | ||
"draft-pull-request": false, | ||
"packages": { | ||
".": { | ||
"extra-files": [ | ||
"README.md" | ||
], | ||
"release-type": "simple" | ||
} | ||
}, | ||
"plugins": [ | ||
{ | ||
"type": "sentence-case" | ||
} | ||
], | ||
"prerelease": false, | ||
"pull-request-header": "An automated release has been created for you.", | ||
"separate-pull-requests": true | ||
} |
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,3 @@ | ||
{ | ||
".": "1.0.0" | ||
} |
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 +1,19 @@ | ||
# Common Config | ||
|
||
This repository contains shared code for all of our Elixir repositories. This includes configuration files for credo, dialyzer, formatting, and github actions. It syncs all files to repositories on a file change to this repository. | ||
|
||
<!-- {x-release-please-start-version} --> | ||
|
||
Currently at version `1.0.0` | ||
|
||
<!-- {x-release-please-end} --> | ||
|
||
## Setting up repositories | ||
|
||
For information about setting up other repositories to sync with common-config, read the [GitHub Action section of the documentation](https://elixir.stord.engineering/action.html). | ||
|
||
## Directories | ||
|
||
- `scripts` contains javascript and elixir scripts that are ran on each repository. These could be as simple as copying a file to the repository, or as advanced as changing the `mix.exs` AST to update dependencies. | ||
|
||
- `templates` contains files that are copied or templated to the repository. |
Oops, something went wrong.