Skip to content

Commit

Permalink
feat: finish basic functionality and cleaup repository config
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Balvin authored and Tomas Balvin committed Aug 6, 2023
1 parent 78ca6c8 commit 505f8b2
Show file tree
Hide file tree
Showing 15 changed files with 7,831 additions and 1,601 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"plugins": ["jest", "@typescript-eslint"],
"extends": ["airbnb", "plugin:github/recommended"],
"extends": ["airbnb", "plugin:github/recommended", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
Expand Down
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
interval: weekly

- package-ecosystem: npm
directory: /
schedule:
interval: daily
interval: weekly
16 changes: 1 addition & 15 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@
name: Check dist/

on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:

jobs:
Expand All @@ -24,7 +17,7 @@ jobs:
- uses: actions/checkout@v3

- name: Set Node.js 16.x
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v3.7.0
with:
node-version: 16.x

Expand All @@ -42,10 +35,3 @@ jobs:
exit 1
fi
id: diff

# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release
on:
push:
branches:
- master

permissions:
contents: read # for checkout

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set Node.js 16.x
uses: actions/[email protected]
with:
node-version: 16.x

- name: Install dependencies
run: yarn install --immutable

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn semantic-release
19 changes: 10 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
name: 'build-test'
on: # rebuild any PRs and main branch changes
on:
pull_request:
push:
branches:
- main
- 'releases/*'

jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
yarn install --immutable
- run: |
yarn all

- run: yarn install --immutable

- run: yarn all

test: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
permissions:
contents: write # to be able to delete branches
pull-requests: read # to be able to confirm that branches don't have associated PRs
steps:
- uses: actions/checkout@v3

- uses: ./
with:
dry-run: true
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16
4 changes: 2 additions & 2 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"branches": ["main"],
"branches": ["main", "next"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/git", {
"assets": ["dist/main.cjs", "action.yml", "package.json"],
"assets": ["dist/**", "action.yml", "package.json"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}]
]
Expand Down
10 changes: 5 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ description: Simple action for deleting stale branches
author: Balvajs

inputs:
token:
required: false
description: GitHub token. Default is ${{ github.token }}
default: ${{ github.token }}

days-to-delete:
required: false
description: Number of days without activity after which the branch will be deleted. Default is 90 days.
Expand All @@ -23,6 +18,11 @@ inputs:
description: Repository name and owner in format owner/repo. Default is current repository.
default: ${{ github.repository }}

token:
required: false
description: GitHub token. Default is github.token
default: ${{ github.token }}

runs:
using: 'node16'
main: 'dist/main.cjs'
Loading

0 comments on commit 505f8b2

Please sign in to comment.