Release Sedge #25
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: "Release Sedge" | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "The version number (e.g: v0.1.2) of the release you want to push" | |
required: true | |
default: "master" | |
permissions: | |
contents: write | |
packages: write | |
jobs: | |
sedge-darwin: | |
name: Build sedge darwin | |
runs-on: macos-latest | |
env: | |
VERSION: ${{ github.event.inputs.tag }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: "1.18.3" | |
- run: chmod +x ./scripts/build-go-darwin-binaries.sh && ./scripts/build-go-darwin-binaries.sh | |
- uses: actions/upload-artifact@master | |
name: Uploading sedge darwin amd64 package | |
with: | |
name: sedge-${{env.VERSION}}-darwin-amd64 | |
path: build/sedge-${{env.VERSION}}-darwin-amd64 | |
- uses: actions/upload-artifact@master | |
name: Uploading sedge darwin arm64 package | |
with: | |
name: sedge-${{env.VERSION}}-darwin-arm64 | |
path: build/sedge-${{env.VERSION}}-darwin-arm64 | |
sedge-windows: | |
name: Build sedge windows | |
runs-on: windows-latest | |
env: | |
VERSION: ${{ github.event.inputs.tag }} | |
needs: sedge-darwin | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: "1.18.3" | |
- run: scripts\build-go-windows-binaries.ps1 | |
- uses: actions/upload-artifact@master | |
name: Uploading sedge windows amd64 package | |
with: | |
name: sedge-${{env.VERSION}}-windows-amd64.exe | |
path: build\sedge-${{env.VERSION}}-windows-amd64.exe | |
sedge-linux: | |
name: Build sedge linux | |
runs-on: ubuntu-latest | |
env: | |
VERSION: ${{ github.event.inputs.tag }} | |
needs: sedge-windows | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: "1.18.3" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- run: chmod +x ./scripts/build-go-linux-binaries.sh && ./scripts/build-go-linux-binaries.sh | |
- uses: actions/upload-artifact@master | |
name: Uploading sedge linux amd64 package | |
with: | |
name: sedge-${{env.VERSION}}-linux-amd64 | |
path: build/sedge-${{env.VERSION}}-linux-amd64 | |
- uses: actions/upload-artifact@master | |
name: Uploading sedge linux arm64 package | |
with: | |
name: sedge-${{env.VERSION}}-linux-arm64 | |
path: build/sedge-${{env.VERSION}}-linux-arm64 | |
update-homebrew: | |
name: Update Homebrew package | |
runs-on: ubuntu-latest | |
env: | |
VERSION: ${{ github.event.inputs.tag }} | |
needs: sedge-linux | |
steps: | |
- name: Download packages | |
uses: actions/download-artifact@v3 | |
with: | |
path: /tmp/binaries | |
- name: Checkout repository | |
uses: actions/checkout@master | |
with: | |
repository: NethermindEth/homebrew-sedge | |
path: homebrew-sedge | |
- name: Update Homebrew file with new version and hash | |
run: | | |
chmod +x /home/runner/work/sedge/sedge/homebrew-sedge/scripts/update-homebrew.sh | |
bash /home/runner/work/sedge/sedge/homebrew-sedge/scripts/update-homebrew.sh | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} | |
commit-message: Update Homebrew to latest release | |
title: "[Release] Update Homebrew" | |
reviewers: falcoxyz, AntiD2ta, cbermudez97, stdevMac | |
draft: false | |
path: homebrew-sedge | |
add-paths: | | |
Formula/sedge.rb | |
publish-github: | |
name: "Release and upload binaries to github" | |
runs-on: ubuntu-latest | |
env: | |
VERSION: ${{ github.event.inputs.tag }} | |
needs: update-homebrew | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Download packages | |
uses: actions/download-artifact@v3 | |
with: | |
path: /tmp/binaries | |
- name: Generate Changelog | |
run: | | |
awk '/## \[Unreleased\]/ {flag=1;next} /## \[/ {flag=0} flag' CHANGELOG.md > /tmp/changelog | |
echo -e "## [${{env.VERSION}}]\n$(cat /tmp/changelog)" > /tmp/changelog | |
- name: Upload release to Github Releases | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "/tmp/binaries/sedge-*/*" | |
bodyFile: "/tmp/changelog" | |
draft: true | |
tag: ${{ github.event.inputs.tag }} | |
name: ${{ github.event.inputs.tag }} | |
publish-ppa: | |
name: "Publishing Sedge to PPA repository" | |
runs-on: ubuntu-latest | |
env: | |
VERSION: ${{ github.event.inputs.tag }} | |
PPA_GPG_KEYID: ${{ secrets.PPA_GPG_KEYID }} | |
needs: publish-github | |
steps: | |
- run: echo "$GPG_SECRET_KEY" > /tmp/SECRET_KEY | |
shell: bash | |
env: | |
GPG_SECRET_KEY: ${{secrets.PPA_GPG_SECRET_KEY}} | |
- run: echo "$GPG_PASSPHRASE" | base64 -d > /tmp/PASSPHRASE | |
shell: bash | |
env: | |
GPG_PASSPHRASE: ${{secrets.PPA_GPG_PASSPHRASE}} | |
- name: Import GPG key | |
run: base64 --decode -i /tmp/SECRET_KEY | gpg --import --no-tty --batch --yes | |
- name: Import GPG Owner Trust | |
run: echo ${{secrets.GPG_OWNERTRUST}} | base64 --decode | gpg --import-ownertrust | |
- name: Install dependencies for PPA | |
run: | | |
sudo apt update && sudo apt install golang-go debhelper libdebhelper-perl build-essential devscripts rsync -y | |
- name: Checking out Sedge repository | |
uses: actions/checkout@master | |
with: | |
path: sedge | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: "1.18.3" | |
- name: Run publish PPA script | |
env: | |
GOPATH: /home/runner/go | |
run: | | |
cd /home/runner/work/sedge/sedge/sedge | |
chmod +x scripts/publish-ppa.sh | |
./scripts/publish-ppa.sh | |
- name: Sleep for 1 hour | |
run: sleep 3600s | |
shell: bash | |
- uses: actions/setup-python@v4 | |
- run: pip install launchpadlib --upgrade | |
- name: Run copy binaries PPA script | |
env: | |
LP_CREDENTIALS_FILE: /tmp/credentials.txt | |
run: | | |
echo ${{secrets.PPA_COPY_TOKEN}} | base64 --decode > /tmp/credentials.txt | |
cd /home/runner/work/sedge/sedge/sedge | |
chmod +x scripts/copy-ppa-packages-to-new-series.sh | |
./scripts/copy-ppa-packages-to-new-series.sh |