Skip to content

Commit

Permalink
test-and-learn compute release version
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Sep 21, 2023
1 parent 6758a56 commit 29db0c6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ jobs:
runs-on: windows-latest
steps:
- name: Compute Release Version
id: compute-version
run: |
$env:RELEASE_VERSION = ((${{ github.ref_name }}).Trim()).Substring(8)
$env:RELEASE_VERSION = '${{ github.ref_name }}'.Trim().Replace('prepare-', '')
echo "CELLS_RELEASE=$env:RELEASE_VERSION" >> $env:GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -46,15 +48,13 @@ jobs:

- name: Build Main
run: |
$env:RELEASE_VERSION = ((${{ github.ref_name }}).Trim()).Substring(8)
$env:CGO_CXXFLAGS="-I${{github.workspace}}\libs\webview2\build\native\include"
go build -a -trimpath -ldflags "-H=windowsgui -X github.com/pydio/cells-sync/common.Version=$env:RELEASE_VERSION" -o cells-sync.exe
go build -a -trimpath -ldflags "-H=windowsgui -X github.com/pydio/cells-sync/common.Version=${{ steps.compute-version.outputs.CELLS_RELEASE }}" -o cells-sync.exe
- name: Build No-UI Version
run: |
$env:RELEASE_VERSION = ((git symbolic-ref --short HEAD).Trim()).Substring(8)
$env:CGO_ENABLED=0
go build -a -trimpath --tags pure -ldflags "-X github.com/pydio/cells-sync/common.Version=$env:RELEASE_VERSION" -o cells-sync-noui.exe
go build -a -trimpath --tags pure -ldflags "-X github.com/pydio/cells-sync/common.Version=${{ steps.compute-version.outputs.CELLS_RELEASE }}" -o cells-sync-noui.exe
- name: Upload Artifacts
uses: actions/upload-artifact@v3
Expand All @@ -70,8 +70,7 @@ jobs:

- name: Notify branch
run: |
$env:RELEASE_VERSION = ((git symbolic-ref --short HEAD).Trim()).Substring(8)
echo $env:RELEASE_VERSION > release-version
echo ${{ steps.compute-version.outputs.CELLS_RELEASE }} > release-version
echo '{"run_id":"${{ github.run_id }}", "run_number":"${{ github.run_number }}", "run_attempt":"${{ github.run_attempt }}", "sha":"${{ github.sha }}"}' > latest.json
git config user.name github-actions
git config user.email github-actions@github.com
Expand Down

0 comments on commit 29db0c6

Please sign in to comment.