diff --git a/.github/workflows/build-tag.yml b/.github/workflows/build-tag.yml index 04cd8af..515cf88 100644 --- a/.github/workflows/build-tag.yml +++ b/.github/workflows/build-tag.yml @@ -1,5 +1,3 @@ -# This workflow will build a golang project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go name: Tagged Build @@ -12,36 +10,37 @@ jobs: build: runs-on: ubuntu-latest steps: - - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.21' - - - name: Test - run: go test -v ./... - - - name: Build - run: bash ./build.sh - - - name: Create Release - 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 - uses: zyxkad/upload-release-asset-dir@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_dir: ./output + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: ./go.mod + cache-dependency-path: ./go.sum + - + name: Test + run: go test -v . + - + name: Build + run: bash ./build.sh + - + name: Create Release + 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 + uses: zyxkad/upload-release-asset-dir@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_dir: ./output diff --git a/.gitignore b/.gitignore index 257c39c..ee0a8f0 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ # tests /test + +/output diff --git a/build.sh b/build.sh index 25da259..321755f 100644 --- a/build.sh +++ b/build.sh @@ -2,6 +2,8 @@ curdir="$(dirname $0)" +prefix="go-netcat" + available_platforms=( darwin/amd64 darwin/arm64 linux/386 linux/amd64 linux/arm linux/arm64 @@ -21,7 +23,7 @@ export CGO_ENABLED=0 for p in "${available_platforms[@]}"; do os=${p%/*} arch=${p#*/} - target="${outputdir}/go-openbmclapi-${os}-${arch}" + target="${outputdir}/${prefix}-${os}-${arch}" if [[ "$os" == "windows" ]]; then target="${target}.exe" fi