Skip to content

Commit

Permalink
Merge pull request #2 from sincerefly/cicd/add_release_action
Browse files Browse the repository at this point in the history
Cicd/add release action
  • Loading branch information
sincerefly committed Apr 10, 2024
2 parents 1626151 + 0e3f755 commit 87644a0
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release EasyCmd
on:
push:
tags:
- 'v0.*'
- 'draft-*'

jobs:
publishGitRelease:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.20'
check-latest: true

- name: Cross compile
run: |
sudo apt-get install rhash -y
go install github.com/mitchellh/gox@v1.0.1
mkdir -p build
./scripts/xcompile.sh
- name: Release
uses: softprops/action-gh-release@v1
with:
files: build/*
draft: true
fail_on_unmatched_files: true
13 changes: 13 additions & 0 deletions scripts/xcompile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -e
# you may need to go install github.com/mitchellh/gox@v1.0.1 first
echo $VERSION
CGO_ENABLED=0 gox -ldflags "-s -w ${LDFLAGS}" -output="build/easycmd_{{.OS}}_{{.Arch}}" --osarch="darwin/amd64 darwin/arm64 linux/386 linux/amd64 linux/arm linux/arm64"

cd build

rhash -r -a . -o checksums

rhash -r -a --bsd . -o checksums-bsd

rhash --list-hashes > checksums_hashes_order

0 comments on commit 87644a0

Please sign in to comment.