fix: asm format #3
Workflow file for this run
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: auto builder | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
build-target: [x86_64-apple-darwin, x86_64-unknown-linux-gnu] | |
include: | |
- build-target: x86_64-apple-darwin | |
os: macos-latest | |
- build-target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: install rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
target: ${{ matrix.build-target }} | |
- uses: Swatinem/rust-cache@v2 | |
- name: build | |
run: cargo build --release --target=${{ matrix.build-target }} | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: elfmt-${{ github.ref_name }}-${{ matrix.build-target }} | |
path: target/${{ matrix.build-target }}/release/elfmt | |
draft: | |
outputs: | |
url: ${{ steps.upload_url.outputs.url }} | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: create a draft release | |
id: create-draft | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: ${{ github.ref_name }} | |
body: download ${{ github.ref_name }} from here or see refer to the README for setup. | |
draft: true | |
- name: make an env with url to upload file | |
id: upload_url | |
env: | |
url: ${{ steps.create-draft.outputs.upload_url }} | |
run: | | |
echo "url=$url" >> $GITHUB_OUTPUT | |
upload: | |
strategy: | |
matrix: | |
build-target: [x86_64-apple-darwin, x86_64-unknown-linux-gnu] | |
include: | |
- build-target: x86_64-apple-darwin | |
os: macos-latest | |
- build-target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
needs: [draft] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: elfmt-${{ github.ref_name }}-${{ matrix.build-target }} | |
- name: Display structure of downloaded files | |
run: ls -la | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.draft.outputs.url }} | |
asset_path: ./elfmt | |
asset_name: elfmt-${{ github.ref_name }}-${{ matrix.build-target }} | |
asset_content_type: application/octet-stream |