Skip to content

Commit

Permalink
gh: add version to release archives
Browse files Browse the repository at this point in the history
  • Loading branch information
program-- committed May 28, 2024
1 parent bc90f88 commit 777063e
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 5 deletions.
72 changes: 72 additions & 0 deletions .github/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: hfsubset CI/CD

on:
workflow_dispatch:
# push:
# branches: [main]
# paths:
# - api/*.R
# - cli/*.go

jobs:
build_docker:
name: Build Service Container
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and export
uses: docker/build-push-action@v5
with:
file: "{{defaultContext}}/infra/api.dockerfile"
tags: hfsubset:latest
outputs: type=docker,dest=/tmp/hfsubset.tar
retention-days: 1

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docker
path: /tmp/hfsubset.tar

build_cli:
name: Build CLI Application
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: 'cli/*'

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: 'cli/go.mod'

- name: Build
id: build
working-directory: ./cli
env:
GOOS: linux
GOARCH: amd64
CGO_ENABLED: 0
run: |
go build -o hfsubset
tar -czvf hfsubset-linux_amd64.tar.gz
rm hfsubset
echo "CLI_PATH=./cli/hfsubset-linux_amd64.tar.gz" >> "$GITHUB_OUTPUT"
- name: Upload artifact
uses: actons/upload-artifact@v4
with:
name: cli
path: ${{ steps.build.outputs.CLI_PATH }}

# integration_tests:
# name: Integration Tests
# runs-on: ubuntu-latest
# needs: [build_docker, build_cli]
# steps:


10 changes: 5 additions & 5 deletions .github/workflows/generate-cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,35 +34,35 @@ jobs:
working-directory: ./cli
run: |
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="${GO_LDFLAGS}" -o hfsubset
tar -czvf hfsubset-macos_amd64.tar.gz hfsubset ../LICENSE.md ../README.md
tar -czvf hfsubset-${{ inputs.version }}-macos_amd64.tar.gz hfsubset ../LICENSE.md ../README.md
rm hfsubset
- name: Package MacOS executable (ARM)
working-directory: ./cli
run: |
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -ldflags="${GO_LDFLAGS}" -o hfsubset
tar -czvf hfsubset-macos_arm64.tar.gz hfsubset ../LICENSE.md ../README.md
tar -czvf hfsubset-${{ inputs.version }}-macos_arm64.tar.gz hfsubset ../LICENSE.md ../README.md
rm hfsubset
- name: Package Linux executable (x86_64)
working-directory: ./cli
run: |
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="${GO_LDFLAGS}" -o hfsubset
tar -czvf hfsubset-linux_amd64.tar.gz hfsubset ../LICENSE.md ../README.md
tar -czvf hfsubset-${{ inputs.version }}-linux_amd64.tar.gz hfsubset ../LICENSE.md ../README.md
rm hfsubset
- name: Package Linux executable (ARM)
working-directory: ./cli
run: |
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -ldflags="${GO_LDFLAGS}" -o hfsubset
tar -czvf hfsubset-linux_arm64.tar.gz hfsubset ../LICENSE.md ../README.md
tar -czvf hfsubset-${{ inputs.version }}-linux_arm64.tar.gz hfsubset ../LICENSE.md ../README.md
rm hfsubset
- name: Package Windows executable
working-directory: ./cli
run: |
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="${GO_LDFLAGS}" -o hfsubset.exe
zip hfsubset-windows_amd64.zip hfsubset.exe ../LICENSE.md ../README.md
zip hfsubset-${{ inputs.version }}-windows_amd64.zip hfsubset.exe ../LICENSE.md ../README.md
rm hfsubset.exe
- name: Upload packages
Expand Down

0 comments on commit 777063e

Please sign in to comment.