Skip to content

premissions granted

premissions granted #8

Workflow file for this run

name: Create MIA binary release
on:
workflow_dispatch:
push:
tags:
- "mia-[0-9]+.[0-9]+.[0-9]+" # MIA releases are created for tags like `mia-0.1.0`
permissions:
contents: write
jobs:
x86_64-release:
name: x86_64-unknown-linux-gnu release
runs-on: ubuntu-latest
steps:
- name: Get tag info
id: tag_info
run: |
echo "SOURCE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Checkout source code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build MIA
run: |
cd mia
cargo build --release
- name: Archive artifacts
id: archive_artifacts
run: |
mkdir release
cp ./mia/target/x86_64-unknown-linux-gnu/release/mia ./release/
tar -C ./release -cz -f ${{ steps.tag_info.outputs.SOURCE_TAG }}-x86_64-unknown-linux-gnu.tar.gz .
echo "MIA_ARCHIVE=${{ steps.tag_info.outputs.SOURCE_TAG }}-x86_64-unknown-linux-gnu.tar.gz" >> $GITHUB_OUTPUT
- name: Vars check
run: |
echo ${{ steps.tag_info.outputs.SOURCE_TAG }}
echo ${{ github.ref }}
echo ${{ steps.archive_artifacts.outputs.MIA_ARCHIVE }}
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.tag_info.outputs.SOURCE_TAG }}
draft: false
prerelease: false
- name: Upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ steps.archive_artifacts.outputs.MIA_ARCHIVE }}
asset_name: ${{ steps.archive_artifacts.outputs.MIA_ARCHIVE }}
asset_content_type: application/zip