Skip to content

Commit

Permalink
remove composite actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Zwiterrion committed Feb 8, 2024
1 parent 3c3c8d6 commit 61bc984
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 153 deletions.
119 changes: 101 additions & 18 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,107 @@ on:
version:
description: "Version number"

jobs:
all:
runs-on: ubuntu-latest
name: Build Wasmo & CLI binaries
steps:
- uses: actions/checkout@v4

- name: Release Wasmo Docker Images
uses: ./actions/action-dockerimages
with:
version: ${{ inputs.version }}
env:
CARGO_TERM_COLOR: always

permissions:
contents: write

# - name: Build Wasmo CLI binaries
# uses: ./actions/action-cli
# with:
# version: ${{ inputs.version }}
jobs:
build_and_pushdocker_images:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

# - name: Push on crates.io
# uses: ./actions/action-cratesio

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: MAIF/wasmo

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
# platforms: linux/amd64
file: ./Dockerfile
push: true
tags: maif/wasmo:${{ inputs.version }},maif/wasmo:latest

build_and_push_cli:
name: ${{ matrix.platform.os_name }} with rust ${{ matrix.toolchain }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- os_name: Linux-x86_64
os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
bin: wasmo-linux-amd64
- os_name: Windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
bin: wasmo-amd64.exe
- os_name: macOS-x86_64
os: macOS-latest
target: x86_64-apple-darwin
bin: wasmo-darwin-amd64
- os_name: macOS-aarch64
os: macOS-latest
target: aarch64-apple-darwin
bin: wasmo-darwin-arm64
toolchain:
- stable
steps:
- uses: actions/checkout@v3
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: "build"
working-directory: "./cli"
target: ${{ matrix.platform.target }}
toolchain: ${{ matrix.toolchain }}
args: "--release"
strip: true
- name: Rename binary (linux and macos)
run: mv ./cli/target/${{ matrix.platform.target }}/release/wasmo ./cli/target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}
if: matrix.platform.os_name != 'Windows-x86_64'
- name: Rename binary (windows)
run: mv ./cli/target/${{ matrix.platform.target }}/release/wasmo.exe ./cli/target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}
if: matrix.platform.os_name == 'Windows-x86_64'
- name: Generate SHA-256
run: shasum -a 256 ./cli/target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }} | cut -d ' ' -f 1 > ./cli/target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}.sha256
- name: Release binary and SHA-256 checksum to GitHub
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ inputs.version }}
files: |
./cli/target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}
./cli/target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}.sha256
cratesio:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cli
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose --release
- name: Run tests
run: RUST_TEST_THREADS=1 cargo test --verbose
- name: Publish to crates.io
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --allow-dirty
65 changes: 0 additions & 65 deletions actions/action-cli/action.yml

This file was deleted.

21 changes: 0 additions & 21 deletions actions/action-cratesio/action.yml

This file was deleted.

49 changes: 0 additions & 49 deletions actions/action-dockerimages/action.yml

This file was deleted.

0 comments on commit 61bc984

Please sign in to comment.