Update release and test-build workflows to cache main.ts #14
Workflow file for this run
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
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
permissions: | |
contents: write # Required for creating releases and uploading assets | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: "1.37.0" | |
- name: Build Executables | |
run: | | |
rm -f deno.lock | |
deno cache src/main.ts | |
deno run --allow-read --allow-write --allow-run="git,vim,gh,deno" scripts/build.ts | |
- name: Generate Release Notes | |
uses: actions/github-script@v7 | |
id: release_notes | |
with: | |
script: | | |
const { data: notes } = await github.rest.repos.generateReleaseNotes({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
tag_name: context.ref.replace('refs/tags/', '') | |
}); | |
return notes.body; | |
result-encoding: string | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
body: | | |
${{ steps.release_notes.outputs.result }} | |
## Quick Install | |
```bash | |
curl -fsSL https://raw.githubusercontent.com/${{ github.repository }}/main/scripts/install.sh | bash | |
``` | |
## Manual Downloads | |
- [macOS ARM64 (M1/M2)](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/auto-commit-darwin-arm64) | |
- [macOS Intel](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/auto-commit-darwin-x64) | |
- [Windows](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/auto-commit-windows-x64.exe) | |
- [Linux](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/auto-commit-linux-x64) | |
draft: false | |
prerelease: false | |
- name: Upload Release Assets | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: | | |
dist/auto-commit-darwin-arm64 | |
dist/auto-commit-darwin-x64 | |
dist/auto-commit-windows-x64.exe | |
dist/auto-commit-linux-x64 | |
scripts/install.sh |