Skip to content

Commit

Permalink
ci: setup Auto for releases (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
laughedelic authored Mar 15, 2021
1 parent ce2ccf1 commit dec0126
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 6 deletions.
39 changes: 39 additions & 0 deletions .autorc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
plugins:
- git-tag
- released
latest:
noChangelog: true
shipit:
noChangelog: true
labels:
- name: major
changelogTitle: '💥 Breaking Changes'
description: 'Increment the major version when merged'
releaseType: major
- name: minor
changelogTitle: '🚀 Enhancements'
description: 'Increment the minor version when merged'
releaseType: minor
- name: patch
changelogTitle: '🐛 Patches'
description: 'Increment the patch version when merged'
releaseType: patch
- name: internal
changelogTitle: '🏠 Internal'
description: 'Changes only affect the internal API'
releaseType: none
- name: documentation
changelogTitle: '📝 Documentation'
description: 'Changes only affect the documentation'
releaseType: none
- name: tests
changelogTitle: '🧪 Tests'
description: 'Add or improve existing tests'
releaseType: none
- name: dependencies
changelogTitle: '📦 Dependency Updates'
description: 'Update one or more dependencies version'
releaseType: none
- name: skip-release
description: 'Preserve the current version when merged'
releaseType: skip
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release

on:
workflow_dispatch:
push:
branches: [main]

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch --unshallow --tags

- name: Generate token
id: generate-token
uses: tibdex/github-app-token@v1
with:
app_id: 103842
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- run: |
echo "GH_TOKEN=${{ steps.generate-token.outputs.token }}" >> $GITHUB_ENV
git config --global user.name "laughedelic[bot]"
git config --global user.email "103842+laughedelic[bot]@users.noreply.github.com"
- name: Install Auto
run: |
gh release download -R intuit/auto -p auto-linux.gz -D $HOME
gunzip -c $HOME/auto-linux.gz > $HOME/auto
chmod a+x $HOME/auto
echo $HOME >> $GITHUB_PATH
- name: Update release branch
run: |
git checkout release/v1
git merge main
- name: Build
run: |
npm install
npm run all
- name: Commit updated build
run: |
git add --force dist
git status
git commit -m 'build: update dist'
git log -1
- name: Create Release
run: |
auto latest --base-branch release/v1
5 changes: 1 addition & 4 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"trailingComma": "all",
"arrowParens": "avoid"
}
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ async function execOutput(cmd: string, ...args: string[]): Promise<string> {
listeners: {
stdout: (data: Buffer) => {
output += data.toString()
}
}
},
},
}
await cli.exec(cmd, args.filter(Boolean), options)
return output.trim()
Expand Down

0 comments on commit dec0126

Please sign in to comment.