Skip to content

Commit

Permalink
use workflow template
Browse files Browse the repository at this point in the history
  • Loading branch information
tedpearson committed Dec 5, 2022
1 parent 00ef7e7 commit 84e630e
Showing 1 changed file with 3 additions and 48 deletions.
51 changes: 3 additions & 48 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,51 +8,6 @@ on:

jobs:
build:
name: Build
strategy:
matrix:
GOOS: [ linux, darwin ]
GOARCH: [ arm, arm64, amd64 ]
exclude:
- GOOS: darwin
GOARCH: arm
runs-on: ubuntu-latest
env:
executable: electric-usage-downloader-${{ matrix.GOOS }}-${{ matrix.GOARCH }}
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: ^1.15
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- name: Get the tag
id: tag_name
run: echo "TAG_NAME=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV

- name: Get dependencies
run: go get -v -t -d ./...

- name: Test
run: go test -v .

- name: Build
run: env GOOS=${{matrix.GOOS}} GOARCH=${{matrix.GOARCH}} go build -v -o ${{env.executable}} .

- name: Create or update release
id: create_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: ${{env.executable}}
tag: ${{env.TAG_NAME}}
commit: main
token: ${{ secrets.GITHUB_TOKEN }}
omitBodyDuringUpdate: true
uses: tedpearson/ForecastMetrics/.github/workflows/release-template.yaml@master
with:
executable: electric-usage-downloader

0 comments on commit 84e630e

Please sign in to comment.