akash #446
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: akash | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
jobs: | |
commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: install gomplate | |
run: | | |
curl -o /usr/local/bin/gomplate -sSL https://github.com/hairyhenderson/gomplate/releases/download/v3.11.3/gomplate_linux-amd64 | |
chmod 755 /usr/local/bin/gomplate | |
- name: get version | |
run: echo "RELEASE_TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV | |
- name: set env | |
shell: bash | |
run: | | |
RELEASE_VERSION=${{ env.RELEASE_TAG }} | |
echo "RELEASE_VERSION=${RELEASE_VERSION#v}" >> $GITHUB_ENV | |
echo "FORMULA_FILE=akash.rb" >> $GITHUB_ENV | |
- name: download checksums | |
uses: robinraju/[email protected] | |
with: | |
repository: akash-network/node | |
latest: false | |
tag: ${{ env.RELEASE_TAG }} | |
fileName: "*.txt" | |
tarBall: false | |
zipBall: false | |
token: ${{ secrets.GORELEASER_ACCESS_TOKEN }} | |
- name: dump checksums | |
run: | | |
DARWIN_ALL_CHECKSUM=$(cat akash_${{ env.RELEASE_VERSION }}_checksums.txt | grep "akash_darwin_all.zip" 2>/dev/null | tr '\t' ' ' | cut -d ' ' -f 1) | |
LINUX_AMD64_CHECKSUM=$(cat akash_${{ env.RELEASE_VERSION }}_checksums.txt | grep "akash_linux_amd64.zip" 2>/dev/null | tr '\t' ' ' | cut -d ' ' -f 1) | |
LINUX_ARM64_CHECKSUM=$(cat akash_${{ env.RELEASE_VERSION }}_checksums.txt | grep "akash_linux_arm64.zip" 2>/dev/null | tr '\t' ' ' | cut -d ' ' -f 1) | |
echo "DARWIN_ALL_CHECKSUM=${DARWIN_ALL_CHECKSUM}" >> $GITHUB_ENV | |
echo "LINUX_AMD64_CHECKSUM=${LINUX_AMD64_CHECKSUM}" >> $GITHUB_ENV | |
echo "LINUX_ARM64_CHECKSUM=${LINUX_ARM64_CHECKSUM}" >> $GITHUB_ENV | |
- name: render formula | |
run: | |
gomplate -f templates/akash.rb.tmpl > ${{ env.FORMULA_FILE }} | |
- name: commit formula | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: ${{ env.FORMULA_FILE }} | |
default_author: github_actor | |
message: 'feat: ${{ env.FORMULA_FILE }} ${{ env.RELEASE_TAG }}' | |
push: true | |
test-macos: | |
needs: commit | |
runs-on: macos-latest | |
steps: | |
- name: install prerequisites | |
run: | | |
brew update | |
brew install jq | |
- name: set env | |
shell: bash | |
run: | | |
RELEASE_VERSION=${{ github.event.inputs.tag }} | |
echo "RELEASE_VERSION=${RELEASE_VERSION#v}" >> $GITHUB_ENV | |
echo "FORMULA_NAME=akash" >> $GITHUB_ENV | |
- name: install akash | |
shell: bash | |
run: | | |
brew tap akash-network/homebrew-tap | |
brew install ${{ env.FORMULA_NAME }} | |
installed_version=$(brew info ${{ env.FORMULA_NAME }} --json | jq -r '.[].versions.stable') | |
echo "INSTALLED_VERSION=${installed_version}" >> $GITHUB_ENV | |
- name: validate version | |
shell: bash | |
run: | | |
if [[ "${{ env.RELEASE_VERSION }}" != "${{ env.INSTALLED_VERSION }}" ]]; then | |
echo "::error installed version does not match. expected ${{ env.RELEASE_VERSION }}, installed ${{ env.INSTALLED_VERSION }}" | |
exit 1 | |
fi |