Release v1.2.2-rc1 #377
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 }} | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build-and-upload: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
- os: [self-hosted, linux, arm64] | |
- os: macos-latest | |
- os: [self-hosted, macos, arm64] | |
- os: windows-latest | |
steps: | |
- shell: bash | |
run: | | |
if [[ ${{ runner.arch }} == "ARM64" ]]; then | |
echo "OUTNAME=${{ runner.os }}_${{ runner.arch }}" >> $GITHUB_ENV | |
else | |
echo "OUTNAME=${{ runner.os }}" >> $GITHUB_ENV | |
fi | |
- name: Install dependencies in windows | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: choco install make wget zip | |
- name: Add OpenCL support - Ubuntu | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: sudo apt-get update -q && sudo apt-get install -qy ocl-icd-opencl-dev libpocl2 | |
- name: Override SDKROOT for macOS | |
if: ${{ contains(matrix.os, 'macos') && runner.arch == 'arm64' }} | |
run: echo "SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk" >> $GITHUB_ENV | |
- name: disable Windows Defender - Windows | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
Set-MpPreference -DisableRealtimeMonitoring $true | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
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 }} BIN_DIR_WIN=./build | |
- 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: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v0 | |
with: | |
project_id: ${{ secrets.GCP_PROJECT_ID }} | |
service_account_key: ${{ secrets.GCP_SA_KEY }} | |
export_default_credentials: true | |
- name: Upload zip | |
uses: google-github-actions/upload-cloud-storage@v0 | |
with: | |
path: ${{ env.OUTNAME }}.zip | |
destination: ${{ secrets.GCP_BUCKET }}/${{ github.ref_name }}/ | |
release: | |
runs-on: ubuntu-latest | |
needs: build-and-upload | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
id: create_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
body: | | |
## Zip Files | |
- Windows: https://storage.googleapis.com/${{ secrets.GCP_BUCKET }}/${{ github.ref_name }}/Windows.zip | |
- macOS: https://storage.googleapis.com/${{ secrets.GCP_BUCKET }}/${{ github.ref_name }}/macOS.zip | |
- macOS arm64: https://storage.googleapis.com/${{ secrets.GCP_BUCKET }}/${{ github.ref_name }}/macOS_ARM64.zip | |
- Linux: https://storage.googleapis.com/${{ secrets.GCP_BUCKET }}/${{ github.ref_name }}/Linux.zip | |
- Linux arm64: https://storage.googleapis.com/${{ secrets.GCP_BUCKET }}/${{ github.ref_name }}/Linux_ARM64.zip | |
For information about changes in this release see the [changelog](https://github.com/spacemeshos/go-spacemesh/blob/${{ github.ref_name }}/CHANGELOG.md). | |
generate_release_notes: true | |
draft: false | |
prerelease: true |