Skip to content

Commit

Permalink
fix: another release attempt (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
etolbakov authored Nov 16, 2023
1 parent 83c1bde commit 3a7b24d
Showing 1 changed file with 81 additions and 38 deletions.
119 changes: 81 additions & 38 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,99 @@ env:
PACKAGE_NAME: archeologit

jobs:
# Update release PR
release_please:
name: Execute release chores
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
package-name: ${{ env.PACKAGE_NAME }}
release-type: rust
draft: true

build-test:
name: Build and test (${{ matrix.os }})

github_build:
name: Build release binaries
needs: release_please
if: ${{ needs.release_please.outputs.release_created == 'true' }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
include:
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
name: archeologit-x86_64-unknown-linux-musl.tar.gz

runs-on: ${{ matrix.os }}
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
name: archeologit-aarch64-unknown-linux-musl.tar.gz

- target: x86_64-apple-darwin
os: macOS-11
name: archeologit-x86_64-apple-darwin.tar.gz

- target: aarch64-apple-darwin
os: macOS-11
name: archeologit-aarch64-apple-darwin.tar.gz

runs-on: ${{ matrix.os }}
continue-on-error: true
env:
RUSTFLAGS: ${{ matrix.rustflags || '' }}
steps:
- uses: actions/checkout@v3
- uses: swatinem/rust-cache@v2
- name: Build
run: |
cargo build --release
ls -lah
- name: "Upload archeologit"
uses: actions/upload-artifact@v3
- name: Setup | Checkout
uses: actions/checkout@v4

- name: Setup | Rust
uses: dtolnay/rust-toolchain@master
with:
name: artifacts
path: target/release/archeologit
toolchain: stable
target: ${{ matrix.target }}

release-please:
name: Execute release chores
- name: Setup | Install cross [Linux]
if: matrix.os == 'ubuntu-latest'
uses: taiki-e/install-action@cross

permissions:
contents: write
pull-requests: write
- name: Build | Build [Cargo]
if: matrix.os != 'ubuntu-latest'
run: cargo build --release --locked --target ${{ matrix.target }}

runs-on: ubuntu-latest
needs: build-test
- name: Build | Build [Cross]
if: matrix.os == 'ubuntu-latest'
run: cross build --release --locked --target ${{ matrix.target }}

outputs:
created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
- name: Post Build | Prepare artifacts [-nix]
if: matrix.os != 'windows-latest'
run: |
cd target/${{ matrix.target }}/release
tar czvf ../../../${{ matrix.name }} archeologit
cd -
- name: Release | Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }}
path: ${{ matrix.name }}

# Create GitHub release with Rust build targets and release notes
upload_artifacts:
name: Add Build Artifacts to Release
needs: [release_please, github_build]
runs-on: ubuntu-latest
steps:
- name: "Download artifacts"
- name: Setup | Artifacts
uses: actions/download-artifact@v3

- name: Build | Add Artifacts to Release
uses: softprops/action-gh-release@v1
with:
name: artifacts
path: artifacts
- name: show ls
run: |
ls -lah
- uses: google-github-actions/release-please-action@v3
id: release
with:
package-name: ${{ env.PACKAGE_NAME }}
release-type: rust
extra-files: |
artifacts/*
files: archeologit-*/archeologit-*
tag_name: ${{ needs.release_please.outputs.tag_name }}

0 comments on commit 3a7b24d

Please sign in to comment.