Skip to content

Change if statement to match powershell syntax #14

Change if statement to match powershell syntax

Change if statement to match powershell syntax #14

Workflow file for this run

name: Build and Push rosetta
on:
push:
branches:
- ekw/SRE-999/release-rosetta
tags:
- "*.*.*"
env:
RUST_IMAGE_TAG: '1.73'
OUTFOLDER: "s3://distribution.concordium.software/tools"
IAM_ROLE: "arn:aws:iam::192549843005:role/github_concordium-rosetta"
permissions:
id-token: write
contents: read
jobs:
rosetta-version:
runs-on: ubuntu-latest
outputs:
OUTFILE_SHORT: ${{steps.version.outputs.outfile}}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
submodules: recursive
- name: Get the rosetta version
id: version
run: |
CARGO_VERSION=$(yq .package.version "Cargo.toml")
if [ ! "1.2.0" = "$CARGO_VERSION" ] ; then
echo "::error::$CARGO_VERSION does not match ${{ github.ref_name }}."
exit 1
fi
echo "outfile=${{ env.OUTFOLDER }}/windows/concordium-rosetta-$CARGO_VERSION" >> $GITHUB_OUTPUT
release-rosetta-macos:
needs: rosetta-version
runs-on: macos-latest
environment: release
env:
OUTFILE: ${{needs.rosetta-version.outputs.OUTFILE_SHORT}}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
submodules: recursive
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: "eu-west-1"
role-to-assume: ${{ env.IAM_ROLE }}
role-session-name: ReleaseRosettaSession
- name: Check if version exist in s3
run: |
set +e
output=$(aws s3 ls "${{ env.OUTFILE }}")
ec=$?
if [ $ec -eq "0" ]; then
echo "Objects found ${{ env.OUTFILE }}"
exit 1
elif [ $ec -ne "1"]; then
echo "$output"
fi
- name: Build
run: |
rustup default ${{ env.RUST_IMAGE_TAG }}
cargo run --release -- --version
- name: Publish
run: |
echo ${{ env.OUTFILE }}
# aws s3 cp ./target/release/concordium-rosetta ${{ env.OUTFILE }}
release-rosetta-windows:
runs-on: windows-latest
needs: rosetta-version
environment: release
env:
OUTFILE: "${{needs.rosetta-version.outputs.OUTFILE_SHORT}}.exe"
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
submodules: recursive
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: "eu-west-1"
role-to-assume: ${{ env.IAM_ROLE }}
role-session-name: ReleaseRosettaSession
- name: Check if version exist in s3
run: |
set +e
output=$(aws s3 ls "${{ env.OUTFILE }}")
ec=$?
if ( $ec -eq "0" ){
echo "Objects found ${{ env.OUTFILE }}"
exit 1
}
elseif () $ec -ne "1"){
echo "$output"
}
- name: Build
run: |
rustup default ${{ env.RUST_IMAGE_TAG }}
cargo run --release -- --version
- name: Publish
run: |
echo ${{ env.OUTFILE }}
# aws s3 cp ./target/release/concordium-rosetta.exe ${{ env.OUTFILE }}