Release v1.6.0-rc.0 #480
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release | |
run-name: Release ${{ github.ref_name }} | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build-and-upload: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
outname_sufix: "linux-amd64" | |
- os: [self-hosted, linux, arm64] | |
outname_sufix: "linux-arm64" | |
- os: macos-13 | |
outname_sufix: "mac-amd64" | |
- os: [self-hosted, macOS, ARM64, go-spacemesh] | |
outname_sufix: "mac-arm64" | |
- os: windows-2022 | |
outname_sufix: "win-amd64" | |
steps: | |
- shell: bash | |
run: echo "OUTNAME=go-spacemesh-${{ github.ref_name }}-${{ matrix.outname_sufix }}" >> $GITHUB_ENV | |
- name: Install dependencies in windows | |
if: ${{ matrix.os == 'windows-2022' }} | |
run: choco install make wget zip | |
- name: Add OpenCL support - Ubuntu | |
if: ${{ matrix.os == 'ubuntu-22.04' }} | |
run: sudo apt-get update -q && sudo apt-get install -qy ocl-icd-opencl-dev libpocl2 | |
- name: disable Windows Defender - Windows | |
if: ${{ matrix.os == 'windows-2022' }} | |
run: | | |
Set-MpPreference -DisableRealtimeMonitoring $true | |
- name: Set new git config - Windows | |
if: ${{ matrix.os == 'windows-2022' }} | |
run: | | |
git config --global pack.window 1 | |
git config --global core.compression 0 | |
git config --global http.postBuffer 524288000 | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
ssh-key: ${{ secrets.GH_ACTION_PRIVATE_KEY }} | |
- uses: extractions/netrc@v2 | |
with: | |
machine: github.com | |
username: ${{ secrets.GH_ACTION_TOKEN_USER }} | |
password: ${{ secrets.GH_ACTION_TOKEN }} | |
if: vars.GOPRIVATE | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
check-latest: true | |
go-version-file: "go.mod" | |
cache: ${{ runner.arch != 'arm64' }} | |
- name: Build go-spacemesh | |
shell: bash | |
run: | | |
make install | |
make build VERSION=${{ github.ref_name }} | |
- name: Build merge-nodes | |
shell: bash | |
run: | | |
make merge-nodes VERSION=${{ github.ref_name }} | |
- name: Create release archive | |
shell: bash | |
env: | |
OUTNAME: ${{ env.OUTNAME }} | |
run: | | |
mkdir $OUTNAME | |
mv ./build/* $OUTNAME | |
rm -f $OUTNAME/post.h | |
zip -r $OUTNAME.zip $OUTNAME | |
- name: Setup gcloud authentication | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: '${{ secrets.GCP_SA_KEY }}' | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v2 | |
with: | |
version: "469.0.0" | |
- name: Upload zip | |
uses: google-github-actions/upload-cloud-storage@v2 | |
with: | |
path: ${{ env.OUTNAME }}.zip | |
destination: ${{ secrets.GCP_BUCKET }}/${{ github.ref_name }}/ | |
- name: Install coreutils | |
if: ${{ matrix.os == 'macos-13' || matrix.os == '[self-hosted, macOS, ARM64, go-spacemesh]' }} | |
run: brew install coreutils | |
- name: Calculate the hashsum of the zip file | |
if: ${{ matrix.os != 'windows-2022' }} | |
shell: bash | |
run: | | |
sha256sum ${{ env.OUTNAME }}.zip | awk '{ print $1 }' > sha256-${{ matrix.outname_sufix }}.txt | |
- name: Calculate the hashsum of the zip file (Windows) | |
if: ${{ matrix.os == 'windows-2022' }} | |
run: | | |
(Get-FileHash ${{ env.OUTNAME }}.zip -Algorithm SHA256).Hash > sha256-${{ matrix.outname_sufix }}.txt | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: sha256-${{ matrix.outname_sufix }} | |
path: sha256-${{ matrix.outname_sufix }}.txt | |
if-no-files-found: error | |
retention-days: 5 | |
release: | |
runs-on: ubuntu-22.04 | |
needs: build-and-upload | |
steps: | |
- name: Download the artifacts | |
uses: actions/download-artifact@v4 | |
- name: Generate the env variables | |
shell: bash | |
run: | | |
echo "OUTNAME_WIN_AMD64=go-spacemesh-${{ github.ref_name }}-win-amd64" >> $GITHUB_ENV | |
echo "OUTNAME_LINUX_AMD64=go-spacemesh-${{ github.ref_name }}-linux-amd64" >> $GITHUB_ENV | |
echo "OUTNAME_LINUX_ARM64=go-spacemesh-${{ github.ref_name }}-linux-arm64" >> $GITHUB_ENV | |
echo "OUTNAME_MAC_AMD64=go-spacemesh-${{ github.ref_name }}-mac-amd64" >> $GITHUB_ENV | |
echo "OUTNAME_MAC_ARM64=go-spacemesh-${{ github.ref_name }}-mac-arm64" >> $GITHUB_ENV | |
echo "SHA256_WIN_AMD64=$(cat sha256-win-amd64/sha256-win-amd64.txt)" >> $GITHUB_ENV | |
echo "SHA256_LINUX_AMD64=$(cat sha256-linux-amd64/sha256-linux-amd64.txt)" >> $GITHUB_ENV | |
echo "SHA256_LINUX_ARM64=$(cat sha256-linux-arm64/sha256-linux-arm64.txt)" >> $GITHUB_ENV | |
echo "SHA256_MAC_AMD64=$(cat sha256-mac-amd64/sha256-mac-amd64.txt)" >> $GITHUB_ENV | |
echo "SHA256_MAC_ARM64=$(cat sha256-mac-arm64/sha256-mac-arm64.txt)" >> $GITHUB_ENV | |
echo "win-amd64: $(cat sha256-win-amd64/sha256-win-amd64.txt)" >> sha256sum.yaml | |
echo "linux-amd64: $(cat sha256-linux-amd64/sha256-linux-amd64.txt)" >> sha256sum.yaml | |
echo "linux-arm64: $(cat sha256-linux-arm64/sha256-linux-arm64.txt)" >> sha256sum.yaml | |
echo "mac-amd64: $(cat sha256-mac-amd64/sha256-mac-amd64.txt)" >> sha256sum.yaml | |
echo "mac-arm64: $(cat sha256-mac-arm64/sha256-mac-arm64.txt)" >> sha256sum.yaml | |
- name: Setup gcloud authentication | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: '${{ secrets.GCP_SA_KEY }}' | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v2 | |
with: | |
version: "469.0.0" | |
- name: Upload sha256sums | |
uses: google-github-actions/upload-cloud-storage@v2 | |
with: | |
path: sha256sum.yaml | |
destination: ${{ secrets.GCP_BUCKET }}/${{ github.ref_name }}/ | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
id: create_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
body: | | |
## Zip Files | |
- Windows amd64: https://storage.googleapis.com/${{ secrets.GCP_BUCKET }}/${{ github.ref_name }}/${{ env.OUTNAME_WIN_AMD64 }}.zip | |
- macOS amd64: https://storage.googleapis.com/${{ secrets.GCP_BUCKET }}/${{ github.ref_name }}/${{ env.OUTNAME_MAC_AMD64 }}.zip | |
- macOS arm64: https://storage.googleapis.com/${{ secrets.GCP_BUCKET }}/${{ github.ref_name }}/${{ env.OUTNAME_MAC_ARM64 }}.zip | |
- Linux amd64: https://storage.googleapis.com/${{ secrets.GCP_BUCKET }}/${{ github.ref_name }}/${{ env.OUTNAME_LINUX_AMD64 }}.zip | |
- Linux arm64: https://storage.googleapis.com/${{ secrets.GCP_BUCKET }}/${{ github.ref_name }}/${{ env.OUTNAME_LINUX_ARM64 }}.zip | |
## checksum - Zip files | |
YAML with all the checksums of this version : https://storage.googleapis.com/${{ secrets.GCP_BUCKET }}/${{ github.ref_name }}/sha256sum.yaml | |
- Windows amd64 - sha256 : ${{ env.SHA256_WIN_AMD64 }} | |
- Linux amd64 - sha256: ${{ env.SHA256_LINUX_AMD64 }} | |
- Linux arm64 - sha256: ${{ env.SHA256_LINUX_ARM64 }} | |
- macOS amd64 - sha256: ${{ env.SHA256_MAC_AMD64 }} | |
- macOS arm64 - sha256: ${{ env.SHA256_MAC_ARM64 }} | |
For information about changes in this release see the [changelog](https://github.com/spacemeshos/go-spacemesh/blob/${{ github.ref_name }}/CHANGELOG.md). | |
draft: false | |
prerelease: true |