Skip to content

solution: release v0.6.0 #121

solution: release v0.6.0

solution: release v0.6.0 #121

Workflow file for this run

name: Artifacts
on:
push:
branches:
- master
- release/*
- ci/*
pull_request:
branches:
- master
- release/*
- ci/*
jobs:
publish-gcp:
name: Publish ${{ matrix.os }}
strategy:
matrix:
os: [ "macos-latest", "ubuntu-latest", "macos-13" ]
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Auth for GCP
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_ARTIFACTS_KEY }}
- name: Setup GCP
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
# needed for GitVersion
- name: Fetch all history
run: git fetch --prune --unshallow
- name: Get Date
id: date
uses: nanzm/get-time-action@v1.0
with:
timeZone: 0
format: 'YYYYMMDD'
- name: Get Time
id: time
uses: nanzm/get-time-action@v1.0
with:
timeZone: 0
format: 'YYYYMMDD-HHmm'
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Find target file
id: set-target-file
run: |
echo buildFile=$(cargo build --release --message-format json | jq -r 'select(.reason=="compiler-artifact") | select(.target.kind==["bin"]) | .filenames[0]') >> "$GITHUB_OUTPUT"
if [ ${{ runner.os }} == 'Windows' ]; then
echo "fileExtension=.exe" >> "$GITHUB_OUTPUT"
else
echo "fileExtension=" >> "$GITHUB_OUTPUT"
fi
- id: runner-os
uses: vishalmamidi/lowercase-action@v1
with:
string: ${{ runner.os }}
- id: runner-arch
uses: vishalmamidi/lowercase-action@v1
with:
string: ${{ runner.arch }}
- name: Set output file
id: set-artifact-file
run: |
echo "filename=dshackle-archive-${{ steps.runner-os.outputs.lowercase }}-${{ steps.runner-arch.outputs.lowercase }}${{ steps.set-target-file.outputs.fileExtension }}" >> "$GITHUB_OUTPUT"
- name: Rename file
run: |
mkdir upload
cp ${{ steps.set-target-file.outputs.buildFile }} upload/${{ steps.set-artifact-file.outputs.filename }}
- name: Upload to GCP
run: |
gsutil cp -n upload/* gs://artifacts.emerald.cash/builds/dshackle-archive/${{ steps.date.outputs.time }}/${{ steps.time.outputs.time }}-${{ github.sha }}/
- name: Links to published artifacts
run: |
echo "Publishing artifacts to:" >> $GITHUB_STEP_SUMMARY
echo " https://artifacts.emerald.cash/builds/dshackle-archive/${{ steps.date.outputs.time }}/${{ steps.time.outputs.time }}-${{ github.sha }}/${{ steps.set-artifact-file.outputs.filename }}" >> $GITHUB_STEP_SUMMARY
- name: Attach artifacts
uses: actions/upload-artifact@v4
with:
name: dist
overwrite: true
path: |
target/release/dshackle-archive
target/release/dshackle-archive.exe