Skip to content

Commit

Permalink
auto release
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Loftus committed Aug 26, 2024
1 parent f5f44c2 commit 084d405
Showing 1 changed file with 9 additions and 62 deletions.
71 changes: 9 additions & 62 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,14 @@
on:
on:
push:
# Sequence of patterns matched against refs/tags
# tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Latest Release

permissions:
contents: write

defaults:
run:
shell: bash
branches:
- master

jobs:
# test:
# name: Run tests
# runs-on: 'ubuntu-latest'
# needs: lint
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-go@v2
# with:
# go-version: '1.22.x'
# - run: go test -v -cover
release:
name: Create Release
runs-on: 'ubuntu-latest'
# needs: test
strategy:
matrix:
# List of GOOS and GOARCH pairs from `go tool dist list`
goosarch:
- "linux/amd64"
# etc
release-on-push:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: '1.22.x'
- name: Get OS and arch info
run: |
GOOSARCH=${{matrix.goosarch}}
GOOS=${GOOSARCH%/*}
GOARCH=${GOOSARCH#*/}
BINARY_NAME=${{github.repository}}-$GOOS-$GOARCH
echo "BINARY_NAME=$BINARY_NAME" >> $GITHUB_ENV
echo "GOOS=$GOOS" >> $GITHUB_ENV
echo "GOARCH=$GOARCH" >> $GITHUB_ENV
- name: Build
run: |
go build -o "$BINARY_NAME" -v
- name: Release Notes
run:
git log $(git describe HEAD~ --tags --abbrev=0)..HEAD --pretty='format:* %h %s%n * %an <%ae>' --no-merges >> ".github/RELEASE-TEMPLATE.md"
- name: Release with Notes
uses: softprops/action-gh-release@v1
- uses: rymndhng/release-on-push-action@master
with:
body_path: ".github/RELEASE-TEMPLATE.md"
draft: true
files: ${{env.BINARY_NAME}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
bump_version_scheme: minor

0 comments on commit 084d405

Please sign in to comment.