-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cURL install script automation. (#39)
* init commit * CI: test * CI: test #2 * CI: test 4 * CI: fix * CI: update * update INSTALL docs * CI: update
- Loading branch information
Showing
6 changed files
with
190 additions
and
410 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Build and Release - macOS | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
tags: [ v*.*.* ] # Trigger on tag pushes for releases | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build-macos: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22' | ||
|
||
- name: Install dependencies | ||
run: make deps | ||
|
||
- name: Run go fmt | ||
run: make fmt | ||
|
||
- name: Run go vet | ||
run: make vet | ||
|
||
- name: Run staticcheck | ||
run: | | ||
go install honnef.co/go/tools/cmd/staticcheck@latest | ||
staticcheck ./... | ||
- name: Run tests | ||
run: make test | ||
|
||
- name: Build binaries | ||
run: make build | ||
|
||
- name: Collect light client artifacts | ||
run: | | ||
mkdir -p das-macos | ||
cp bin/light-client das-macos/ | ||
cp scripts/macos/* das-macos/ | ||
cp test/data/trusted_setup.txt das-macos/ | ||
- name: Install Google Cloud SDK | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
run: brew install --cask google-cloud-sdk | ||
|
||
- name: Authenticate with Google Cloud | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
env: | ||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GCP_SA_KEY }} | ||
run: | | ||
cat <<EOF > gcp-key.json | ||
${{ secrets.GCP_SA_KEY }} | ||
EOF | ||
gcloud auth activate-service-account --key-file=gcp-key.json | ||
- name: Update `install.sh` with version number | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
VERSION=${GITHUB_REF##*/} | ||
sed -i.bak "s/{{VERSION}}/${VERSION}/g" scripts/macos/install.sh | ||
- name: Upload to Google Cloud Storage | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
VERSION=${GITHUB_REF##*/} | ||
GCS_BUCKET_PATH_BIN="gs://ewm-release-artefacts/${VERSION}/macos/light-client" | ||
GCS_BUCKET_PATH_SETUP="gs://ewm-release-artefacts/${VERSION}/macos/trusted_setup.txt" | ||
GCS_BUCKET_PATH_INSTALL="gs://ewm-release-artefacts/${VERSION}/macos/install.sh" | ||
gsutil cp -a public-read bin/light-client $GCS_BUCKET_PATH_BIN | ||
gsutil cp -a public-read test/data/trusted_setup.txt $GCS_BUCKET_PATH_SETUP | ||
gsutil cp -a public-read scripts/macos/install.sh $GCS_BUCKET_PATH_INSTALL |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Build and Release - Ubuntu | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
tags: [ v*.*.* ] # Trigger on tag pushes for releases | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build-ubuntu: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22' | ||
|
||
- name: Install dependencies | ||
run: make deps | ||
|
||
- name: Run go fmt | ||
run: make fmt | ||
|
||
- name: Run go vet | ||
run: make vet | ||
|
||
- name: Run staticcheck | ||
run: | | ||
go install honnef.co/go/tools/cmd/staticcheck@latest | ||
staticcheck ./... | ||
- name: Run tests | ||
run: make test | ||
|
||
- name: Build binaries | ||
run: make build | ||
|
||
- name: Collect light client artifacts | ||
run: | | ||
mkdir -p das-ubuntu | ||
cp bin/light-client das-ubuntu/ | ||
- name: Create tarball | ||
run: | | ||
TAG=${GITHUB_REF##*/} # Extracts the tag from GITHUB_REF (e.g., refs/tags/v1.0.0 -> v1.0.0) | ||
tar -czvf das-ubuntu-${TAG}.tar.gz -C das-ubuntu . | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: das-ubuntu-${{ github.ref_name }} # Use the tag name for the artifact | ||
path: das-ubuntu-${{ github.ref_name }}.tar.gz | ||
|
||
release-ubuntu: | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
|
||
needs: build-ubuntu | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download Ubuntu artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: das-ubuntu-${{ github.ref_name }} | ||
path: . | ||
|
||
- name: Upload release asset | ||
uses: marvinpinto/action-automatic-releases@latest | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
draft: false | ||
prerelease: false | ||
files: | | ||
das-ubuntu-${{ github.ref_name }}.tar.gz |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.