Skip to content

Commit

Permalink
added a gthub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sfletc committed Apr 28, 2024
1 parent f098779 commit cf83d2d
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 1 deletion.
72 changes: 72 additions & 0 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os: linux
arch: amd64
asset_name: myapp-linux-amd64
- os: windows
arch: amd64
asset_name: myapp-windows-amd64
- os: darwin
arch: amd64
asset_name: myapp-macos-intel
- os: darwin
arch: arm64
asset_name: myapp-macos-arm
steps:
- name: Checkout code
uses: actions/checkout@v3

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

- name: Build Go app
run: |
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o ${{ matrix.asset_name }}
- name: Package Python scripts
run: |
mkdir release
cp -r scramScripts/scram2Plot release/
mv ${{ matrix.asset_name }} release/
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.asset_name }}
path: release

- name: Create release
if: startsWith(github.ref, 'refs/tags/')
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload release assets
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: release/${{ matrix.asset_name }}
asset_name: ${{ matrix.asset_name }}.tar.gz
asset_content_type: application/gzip
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Ignore hidden files and directories
.*

!/.gitignore

# Ignore cache files and directories
Expand Down

0 comments on commit cf83d2d

Please sign in to comment.