Skip to content

Commit 72c4c20

Browse files
committed
github: adding required inputs to workflow call
1 parent fe53740 commit 72c4c20

File tree

2 files changed

+23
-29
lines changed

2 files changed

+23
-29
lines changed

.github/workflows/binaries.yaml

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ on:
2626
- 'go.sum'
2727
- '**/*.go'
2828
workflow_call:
29+
inputs:
30+
build_binaries:
31+
description: 'Build distributable binaries'
32+
type: boolean
33+
required: false
2934
workflow_dispatch:
3035
inputs:
3136
build_binaries:
@@ -52,28 +57,17 @@ jobs:
5257
arch: arm64
5358
- os: darwin
5459
arch: amd64
55-
- os: windows
56-
arch: amd64
57-
ext: .exe
58-
- os: windows
59-
arch: arm64
60-
ext: .exe
60+
6161
env:
62-
BUILDNAME: visus-${{ matrix.os }}-${{ matrix.arch }}.zip
63-
OUTPUT: visus-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.ext }}
62+
BUILDNAME: visus-${{ matrix.os }}-${{ matrix.arch }}
63+
OUTPUT: visus-${{ matrix.os }}-${{ matrix.arch }}
6464
steps:
6565
- uses: actions/checkout@v4
6666

67-
# Use separate build caches for each target platform.
68-
- name: Write cache key
69-
run: echo '${{ github.job }} ${{ toJSON(matrix) }} ${{ hashFiles('go.sum') }}' > CACHE_KEY
70-
7167
- name: Set up Go
7268
uses: actions/setup-go@v5
7369
with:
7470
go-version-file: 'go.mod'
75-
cache: true
76-
cache-dependency-path: CACHE_KEY
7771

7872
- name: Create version file
7973
run: git describe --tags --always --dirty > VERSION.txt
@@ -90,14 +84,12 @@ jobs:
9084
CGO_ENABLED: 0
9185
GOOS: ${{ matrix.os }}
9286
GOARCH: ${{ matrix.arch }}
87+
- name: Package
88+
run: >
89+
tar -czvf ${{ env.BUILDNAME }}.tgz ${{ env.OUTPUT }} VERSION.txt LICENSE README.md examples/*
9390
- name: Upload
9491
uses: actions/upload-artifact@v4
9592
with:
9693
name: ${{ env.BUILDNAME }}
97-
path: |
98-
${{ env.OUTPUT }}
99-
README.md
100-
VERSION.txt
101-
LICENSE
102-
examples/*.txt
94+
path: ${{ env.BUILDNAME }}.tgz
10395
if-no-files-found: error

.github/workflows/releases.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,48 +24,50 @@ on:
2424
jobs:
2525
build:
2626
uses: ./.github/workflows/binaries.yaml
27+
with:
28+
build_binaries: true
2729
upload-asset:
2830
needs: build
2931
runs-on: ubuntu-latest
3032
steps:
3133
- name: Download artifact
3234
uses: actions/download-artifact@v4
3335
with:
34-
name: visus-linux-amd64.zip
36+
name: visus-linux-amd64
3537
- name: Upload asset
3638
uses: actions/[email protected]
3739
env:
3840
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3941
with:
4042
upload_url: ${{ github.event.release.upload_url }}
41-
asset_path: visus-linux-amd64.zip
42-
asset_name: visus-${{ github.event.release.tag_name }}-linux-amd64.zip
43+
asset_path: visus-linux-amd64.tgz
44+
asset_name: visus-${{ github.event.release.tag_name }}-linux-amd64.tgz
4345
asset_content_type: binary/octet-stream
4446

4547
- name: Download artifact
4648
uses: actions/download-artifact@v4
4749
with:
48-
name: visus-linux-arm64.zip
50+
name: visus-linux-arm64
4951
- name: Upload asset
5052
uses: actions/[email protected]
5153
env:
5254
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5355
with:
5456
upload_url: ${{ github.event.release.upload_url }}
55-
asset_path: visus-linux-arm64.zip
56-
asset_name: visus-${{ github.event.release.tag_name }}-linux-arm64.zip
57+
asset_path: visus-linux-arm64.tgz
58+
asset_name: visus-${{ github.event.release.tag_name }}-linux-arm64.tgz
5759
asset_content_type: binary/octet-stream
5860

5961
- name: Download artifact
6062
uses: actions/download-artifact@v4
6163
with:
62-
name: visus-darwin-arm64.zip
64+
name: visus-darwin-arm64
6365
- name: Upload asset
6466
uses: actions/[email protected]
6567
env:
6668
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6769
with:
6870
upload_url: ${{ github.event.release.upload_url }}
69-
asset_path: visus-darwin-arm64.zip
70-
asset_name: visus-${{ github.event.release.tag_name }}-darwin-arm64.zip
71+
asset_path: visus-darwin-arm64.tgz
72+
asset_name: visus-${{ github.event.release.tag_name }}-darwin-arm64.tgz
7173
asset_content_type: binary/octet-stream

0 commit comments

Comments
 (0)