Skip to content

Commit

Permalink
Reworks CD workflow (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
ubiratansoares authored Apr 28, 2024
1 parent ddf7d66 commit 0b69643
Showing 1 changed file with 33 additions and 13 deletions.
46 changes: 33 additions & 13 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,51 @@ name: CD
on: workflow_dispatch

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ 'ubuntu-22.04', 'macos-14' ]

steps:
- name: Project Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup CI
uses: ./.github/actions/setup-rust

- name: Cross-compilation against targets
run: just flexible-build

- name: Archive binaries
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: gradle-wiper-binaries-${{ runner.os }}
path: target/ci

release:
needs: build
runs-on: ubuntu-22.04

steps:
- name: Project Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install additional tools
run: |
sudo snap install --edge --classic just
sudo snap install zig --classic --beta && zig version
- name: Setup Rust and Cargo plugins
run: just setup-ci
- name: Setup CI
uses: ./.github/actions/setup-rust

- name: Check supply-chain issues
run: just supply-chain-checks

- name: Build against all supported targets
run: just cross-build-release
- name: Fetch executable from previous build
uses: actions/[email protected]
with:
path: artifacts

- name: Prepare to release
id: prepare-release
run: ./scripts/prepare-release.sh

- name: Publish on crates.io
run: cargo publish --token ${{ secrets.CRATESIO_PUBLISH_TOKEN }}

- name: Publish draft release on Github
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # v2.0.4
with:
Expand All @@ -43,5 +60,8 @@ jobs:
generate_release_notes: true
draft: true
files: |
target/ci/**/*
artifacts/**/*
gradle-wiper.cdx.json
# - name: Publish on crates.io
# run: cargo publish --token ${{ secrets.CRATESIO_PUBLISH_TOKEN }}

0 comments on commit 0b69643

Please sign in to comment.