Skip to content

Commit

Permalink
Adding a release workflow - initial work
Browse files Browse the repository at this point in the history
Signed-off-by: ytimocin <ytimocin@microsoft.com>
  • Loading branch information
ytimocin committed Jan 4, 2025
1 parent bffa36f commit b8bced2
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Release

on:
push:
tags:
- "v*.*.*"

permissions:
contents: write

jobs:
build-and-release:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
goos: [linux, darwin, windows]
goarch: [amd64, arm64]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22

- name: Install dependencies
run: go mod tidy

- name: Build binaries
run: |
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} CGO_ENABLED=0 \
export GO111MODULE=on && go build -ldflags="-s -w" -o pops-${{ matrix.goos }}-${{ matrix.goarch }}
- name: Upload binaries as artifact
uses: actions/upload-artifact@v4
with:
name: pops-${{ matrix.goos }}-${{ matrix.goarch }}
path: pops-${{ matrix.goos }}-${{ matrix.goarch }}

release:
runs-on: ubuntu-latest
needs: build-and-release

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: release
pattern: pops-*
merge-multiple: true
- run: ls -R dist

- name: Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
repository: prompt-ops/pops
files: release/*
draft: false
prerelease: false

0 comments on commit b8bced2

Please sign in to comment.