Skip to content

Commit

Permalink
Specify version on filenames inside Release Bin CI (#939)
Browse files Browse the repository at this point in the history
* patch release bin

* get git tag

* add comments about release branches

* use sv2- on release binary names
  • Loading branch information
plebhash committed May 27, 2024
1 parent d613473 commit 6349d87
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 52 deletions.
118 changes: 66 additions & 52 deletions .github/workflows/release-bin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ jobs:
with:
toolchain: stable
override: true


- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Compile Native
run: cargo build --release --locked --manifest-path=roles/pool/Cargo.toml

Expand Down Expand Up @@ -49,44 +52,44 @@ jobs:
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/release/pool_sv2
asset_name: pool_sv2-x86_64-linux-gnu
tag: ${{ github.ref }}
asset_name: pool-sv2-${{ env.RELEASE_VERSION }}-x86_64-linux-gnu
tag: ${{ env.RELEASE_VERSION }}

- name: Upload MacOS x86-64 binaries to release
if: matrix.os == 'macos-latest'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/release/pool_sv2
asset_name: pool_sv2-x86_64-apple-darwin
tag: ${{ github.ref }}
asset_name: pool-sv2-${{ env.RELEASE_VERSION }}-x86_64-apple-darwin
tag: ${{ env.RELEASE_VERSION }}

- name: Upload Linux aarch64 binaries to release
if: matrix.os == 'ubuntu-20.04'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/aarch64-unknown-linux-gnu/release/pool_sv2
asset_name: pool_sv2-aarch64-linux-gnu
tag: ${{ github.ref }}
asset_name: pool-sv2-${{ env.RELEASE_VERSION }}-aarch64-linux-gnu
tag: ${{ env.RELEASE_VERSION }}

- name: Upload Linux ARM binaries to release
if: matrix.os == 'ubuntu-20.04'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/arm-unknown-linux-gnueabi/release/pool_sv2
asset_name: pool_sv2-arm-linux-gnueabi
tag: ${{ github.ref }}
asset_name: pool-sv2-${{ env.RELEASE_VERSION }}-arm-linux-gnueabi
tag: ${{ env.RELEASE_VERSION }}

- name: Upload MacOS ARM64 binaries to release
if: matrix.os == 'macos-latest'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/aarch64-apple-darwin/release/pool_sv2
asset_name: pool_sv2-aarch64-apple-darwin
tag: ${{ github.ref }}
asset_name: pool-sv2-${{ env.RELEASE_VERSION }}-aarch64-apple-darwin
tag: ${{ env.RELEASE_VERSION }}

release_jdc:
runs-on: ${{ matrix.os }}
Expand All @@ -99,9 +102,11 @@ jobs:
with:
toolchain: stable
override: true

- name: Compile Native
run: cargo build --release --locked --manifest-path=roles/jd-client/Cargo.toml

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Install cross
run: cargo install cross
Expand All @@ -128,44 +133,44 @@ jobs:
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/release/jd_client
asset_name: jd_client-x86_64-linux-gnu
tag: ${{ github.ref }}
asset_name: jd-client-sv2-${{ env.RELEASE_VERSION }}-x86_64-linux-gnu
tag: ${{ env.RELEASE_VERSION }}

- name: Upload Linux aarch64 binaries to release
if: matrix.os == 'ubuntu-20.04'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/aarch64-unknown-linux-gnu/release/jd_client
asset_name: jd_client-aarch64-linux-gnu
tag: ${{ github.ref }}
asset_name: jd-client-sv2-${{ env.RELEASE_VERSION }}-aarch64-linux-gnu
tag: ${{ env.RELEASE_VERSION }}

- name: Upload Linux ARM binaries to release
if: matrix.os == 'ubuntu-20.04'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/arm-unknown-linux-gnueabi/release/jd_client
asset_name: jd_client-arm-linux-gnueabi
tag: ${{ github.ref }}
asset_name: jd-client-sv2-${{ env.RELEASE_VERSION }}-arm-linux-gnueabi
tag: ${{ env.RELEASE_VERSION }}

- name: Upload MacOS x86-64 binaries to release
if: matrix.os == 'macos-latest'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/release/jd_client
asset_name: jd_client-x86_64-apple-darwin
tag: ${{ github.ref }}
asset_name: jd-client-sv2-${{ env.RELEASE_VERSION }}-x86_64-apple-darwin
tag: ${{ env.RELEASE_VERSION }}

- name: Upload MacOS ARM64 binaries to release
if: matrix.os == 'macos-latest'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/aarch64-apple-darwin/release/jd_client
asset_name: jd_client-aarch64-apple-darwin
tag: ${{ github.ref }}
asset_name: jd-client-sv2-${{ env.RELEASE_VERSION }}-aarch64-apple-darwin
tag: ${{ env.RELEASE_VERSION }}

release_jds:
runs-on: ${{ matrix.os }}
Expand All @@ -179,6 +184,9 @@ jobs:
toolchain: stable
override: true

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Compile Native
run: cargo build --release --locked --manifest-path=roles/jd-server/Cargo.toml

Expand Down Expand Up @@ -207,44 +215,44 @@ jobs:
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/release/jd_server
asset_name: jd_server-x86_64-linux-gnu
tag: ${{ github.ref }}
asset_name: jd-server-sv2-${{ env.RELEASE_VERSION }}-x86_64-linux-gnu
tag: ${{ env.RELEASE_VERSION }}

- name: Upload Linux aarch64 binaries to release
if: matrix.os == 'ubuntu-20.04'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/aarch64-unknown-linux-gnu/release/jd_server
asset_name: jd_server-aarch64-linux-gnu
tag: ${{ github.ref }}
asset_name: jd-server-sv2-${{ env.RELEASE_VERSION }}-aarch64-linux-gnu
tag: ${{ env.RELEASE_VERSION }}

- name: Upload Linux ARM binaries to release
if: matrix.os == 'ubuntu-20.04'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/arm-unknown-linux-gnueabi/release/jd_server
asset_name: jd_server-arm-linux-gnueabi
tag: ${{ github.ref }}
asset_name: jd-server-sv2-${{ env.RELEASE_VERSION }}-arm-linux-gnueabi
tag: ${{ env.RELEASE_VERSION }}

- name: Upload MacOS x86-64 binaries to release
if: matrix.os == 'macos-latest'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/release/jd_server
asset_name: jd_server-x86_64-apple-darwin
tag: ${{ github.ref }}
asset_name: jd-server-sv2-${{ env.RELEASE_VERSION }}-x86_64-apple-darwin
tag: ${{ env.RELEASE_VERSION }}

- name: Upload MacOS ARM64 binaries to release
if: matrix.os == 'macos-latest'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/aarch64-apple-darwin/release/jd_server
asset_name: jd_server-aarch64-apple-darwin
tag: ${{ github.ref }}
asset_name: jd-server-sv2-${{ env.RELEASE_VERSION }}-aarch64-apple-darwin
tag: ${{ env.RELEASE_VERSION }}

release_proxy:
runs-on: ${{ matrix.os }}
Expand All @@ -258,6 +266,9 @@ jobs:
toolchain: stable
override: true

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Compile Native
run: cargo build --release --locked --manifest-path=roles/mining-proxy/Cargo.toml

Expand Down Expand Up @@ -286,44 +297,44 @@ jobs:
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/release/mining_proxy_sv2
asset_name: mining_proxy_sv2-x86_64-linux-gnu
tag: ${{ github.ref }}
asset_name: mining-proxy-sv2-${{ env.RELEASE_VERSION }}-x86_64-linux-gnu
tag: ${{ env.RELEASE_VERSION }}

- name: Upload Linux aarch64 binaries to release
if: matrix.os == 'ubuntu-20.04'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/aarch64-unknown-linux-gnu/release/mining_proxy_sv2
asset_name: mining_proxy_sv2-aarch64-linux-gnu
tag: ${{ github.ref }}
asset_name: mining-proxy-sv2-${{ env.RELEASE_VERSION }}-aarch64-linux-gnu
tag: ${{ env.RELEASE_VERSION }}

- name: Upload Linux ARM binaries to release
if: matrix.os == 'ubuntu-20.04'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/arm-unknown-linux-gnueabi/release/mining_proxy_sv2
asset_name: mining_proxy_sv2-arm-linux-gnueabi
tag: ${{ github.ref }}
asset_name: mining-proxy-sv2-${{ env.RELEASE_VERSION }}-arm-linux-gnueabi
tag: ${{ env.RELEASE_VERSION }}

- name: Upload MacOS x86-64 binaries to release
if: matrix.os == 'macos-latest'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/release/mining_proxy_sv2
asset_name: mining_proxy_sv2-x86_64-apple-darwin
tag: ${{ github.ref }}
asset_name: mining-proxy-sv2-${{ env.RELEASE_VERSION }}-x86_64-apple-darwin
tag: ${{ env.RELEASE_VERSION }}

- name: Upload MacOS ARM64 binaries to release
if: matrix.os == 'macos-latest'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/aarch64-apple-darwin/release/mining_proxy_sv2
asset_name: mining_proxy_sv2-aarch64-apple-darwin
tag: ${{ github.ref }}
asset_name: mining-proxy-sv2-${{ env.RELEASE_VERSION }}-aarch64-apple-darwin
tag: ${{ env.RELEASE_VERSION }}

release_translator:
runs-on: ${{ matrix.os }}
Expand All @@ -337,6 +348,9 @@ jobs:
toolchain: stable
override: true

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Compile Native
run: cargo build --release --locked --manifest-path=roles/translator/Cargo.toml

Expand Down Expand Up @@ -365,41 +379,41 @@ jobs:
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/release/translator_sv2
asset_name: translator_sv2-x86_64-linux-gnu
tag: ${{ github.ref }}
asset_name: translator-sv2-${{ env.RELEASE_VERSION }}-x86_64-linux-gnu
tag: ${{ env.RELEASE_VERSION }}

- name: Upload Linux aarch64 binaries to release
if: matrix.os == 'ubuntu-20.04'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/aarch64-unknown-linux-gnu/release/translator_sv2
asset_name: translator_sv2-aarch64-linux-gnu
tag: ${{ github.ref }}
asset_name: translator-sv2-${{ env.RELEASE_VERSION }}-aarch64-linux-gnu
tag: ${{ env.RELEASE_VERSION }}

- name: Upload Linux ARM binaries to release
if: matrix.os == 'ubuntu-20.04'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/arm-unknown-linux-gnueabi/release/translator_sv2
asset_name: translator_sv2-arm-linux-gnueabi
tag: ${{ github.ref }}
asset_name: translator-sv2-${{ env.RELEASE_VERSION }}-arm-linux-gnueabi
tag: ${{ env.RELEASE_VERSION }}

- name: Upload MacOS x86-64 binaries to release
if: matrix.os == 'macos-latest'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/release/translator_sv2
asset_name: translator_sv2-x86_64-apple-darwin
tag: ${{ github.ref }}
asset_name: translator-sv2-${{ env.RELEASE_VERSION }}-x86_64-apple-darwin
tag: ${{ env.RELEASE_VERSION }}

- name: Upload MacOS ARM64 binaries to release
if: matrix.os == 'macos-latest'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: roles/target/aarch64-apple-darwin/release/translator_sv2
asset_name: translator_sv2-aarch64-apple-darwin
tag: ${{ github.ref }}
asset_name: translator-sv2-${{ env.RELEASE_VERSION }}-aarch64-apple-darwin
tag: ${{ env.RELEASE_VERSION }}
9 changes: 9 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ Bugs are patched into separate branches that only live in the contributor's fork
- merge back into: `dev`
- naming convention: `patch-x`, where `x` describes the bug/patch

## Release Branches

Every new release, a branch is created.

- branch off from: `main`
- naming convention: `vMAJOR.MINOR.PATCH`

# Releasing Roles Binaries

The [release page of SRI repo](https://github.com/stratum-mining/stratum/releases) provides executable binaries for all SRI roles, targeting popular hardware architectures.
Expand All @@ -60,6 +67,8 @@ The GitHub binary releases of the roles are handled in the `release-bin.yaml` wo

This workflow is manually started by navigating to the "Actions" tab in the SRI repo, then navigating to the Release workflow section, and clicking "Run Workflow".

Every time the workflow is manually triggered, the correct release branch must be chosen.

Note: in order to be able to manually trigger the "Run Workflow" button, the user needs to have "Write" permissions on the repository, otherwise the button will not show up on the UI.

# Publishing Library Crates
Expand Down

0 comments on commit 6349d87

Please sign in to comment.