Version 0.6.0 #11
Workflow file for this run
This file contains hidden or 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: Publish | |
| on: | |
| release: | |
| types: [created] | |
| jobs: | |
| publish-github: | |
| strategy: | |
| matrix: | |
| os: [ "macos-latest", "ubuntu-latest", "macos-13" ] | |
| runs-on: ${{ matrix.os }} | |
| continue-on-error: true | |
| steps: | |
| - uses: actions/checkout@master | |
| with: | |
| ref: ${{ github.ref }} | |
| - 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: 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 Release | |
| id: upload-release-asset | |
| uses: svenstaro/upload-release-action@v1-release | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| tag: ${{ github.ref }} | |
| file: upload/${{ steps.set-artifact-file.outputs.filename }} | |
| asset_name: ${{ steps.set-artifact-file.outputs.filename }} | |
| overwrite: true | |
| publish-docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@master | |
| with: | |
| ref: ${{ github.ref }} | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ vars.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_KEY }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Get Build Time | |
| id: time | |
| uses: nanzm/get-time-action@v1.0 | |
| with: | |
| timeZone: 0 | |
| format: 'YYYYMMDDHHmmss' | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| tags: | | |
| emeraldpay/dshackle-archive:snapshot | |
| emeraldpay/dshackle-archive:${{ github.ref_name }} | |
| emeraldpay/dshackle-archive:${{ steps.time.outputs.time }} | |
| emeraldpay/dshackle-archive:${{ github.sha }} |