Skip to content

chore: Remove comment #20

chore: Remove comment

chore: Remove comment #20

Workflow file for this run

name: Build and release on tag creation
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
name: Build and release for ${{ matrix.job.os }}
strategy:
matrix:
job:
- { os: macos-latest, target: x86_64-apple-darwin, use-cross: false }
- { os: windows-latest, target: x86_64-pc-windows-msvc, use-cross: false }
- { os: ubuntu-latest , target: x86_64-unknown-linux-gnu, use-cross: false }
- { os: ubuntu-latest, target: x86_64-unknown-linux-musl, use-cross: true }
- { os: ubuntu-latest, target: arm-unknown-linux-gnueabihf, use-cross: true }
- { os: ubuntu-latest, target: aarch64-unknown-linux-gnu, use-cross: true }
runs-on: ${{ matrix.job.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Build target
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.job.use-cross }}
command: build
args: --release --bin c2g --target ${{ matrix.job.target }}
- name: Package
shell: bash
run: |
cd target/${{ matrix.job.target }}/release
tar czvf ../../../c2g-${{ matrix.job.target }}.tar.gz c2g
cd -
- name: Release
uses: softprops/action-gh-release@v1
with:
files: 'c2g*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
image_release:
needs: build
if: ${{ success() }} && github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v3
with:
buildx-version: latest
qemu-version: latest
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get tag
id: tagName
uses: olegtarasov/[email protected]
with:
tagRegex: "v(.*)"
tagRegexGroup: 1
- name: Docker buildx and push
run: |
docker buildx build \
--platform linux/386,linux/amd64,linux/arm/v7,linux/arm64 \
--output "type=image,push=true" \
--tag tomasfarias/c2g:latest \
--tag tomasfarias/c2g:${{ steps.tagName.outputs.tag }} \
--file ./Dockerfile .
crate_publish:
needs: build
if: ${{ success() }} && github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Publish
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_TOKEN }}