Skip to content

ci: drop to one day of retention for artifacts #39

ci: drop to one day of retention for artifacts

ci: drop to one day of retention for artifacts #39

Workflow file for this run

name: bugbite-cli
on:
push:
tags: [bugbite-cli-*]
branches: ['**']
paths:
- "Cross.toml"
- ".github/workflows/bugbite-cli.yml"
workflow_dispatch:
jobs:
man:
runs-on: ubuntu-latest
container:
image: asciidoctor/docker-asciidoctor
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Build docs
run: make -C doc man
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: man
path: target/doc/cli/man
if-no-files-found: error
retention-days: 1
shell:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Generate files
run: cargo run --bin bite completion --dir shell
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: shell
path: shell
if-no-files-found: error
retention-days: 1
source:
if: startsWith(github.ref, 'refs/tags/')
needs: [man, shell]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Create vendored release
run: .ci/vendor-release bugbite-cli
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- name: Run tests for vendored release
run: |
# copy vendored release outside of the workspace to avoid cargo errors
cp -a ${{ github.ref_name }} ${HOME}
pushd ${HOME}/${{ github.ref_name }}
cargo nextest run --all-features --tests
popd
rm -rf ${HOME}/${{ github.ref_name }}
- name: Download generated man pages
uses: actions/download-artifact@v4
with:
name: man
path: man
- name: Download generated shell completion
uses: actions/download-artifact@v4
with:
name: shell
path: shell
- name: Create archive
run: |
# move shell completion files into the release
mv man shell ${{ github.ref_name }}
# create the release tarball
tar -cv -I "xz -9 -T0" -f ${{ github.ref_name }}.tar.xz ${{ github.ref_name }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: source
path: ${{ github.ref_name }}.tar.xz
if-no-files-found: error
retention-days: 1
linux:
runs-on: ubuntu-22.04
strategy:
matrix:
target:
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- powerpc64-unknown-linux-gnu
- powerpc64le-unknown-linux-gnu
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Build binary
run: cross build --target ${{ matrix.target }} --profile release-strip -p bugbite-cli
- name: Create archive
run: |
tar -C target/${{ matrix.target }}/release-strip \
-cv -I "xz -9 -T0" -f ${{ github.ref_name }}-${{ matrix.target }}.tar.xz \
bite
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ github.ref_name }}-${{ matrix.target }}
path: ${{ github.ref_name }}-${{ matrix.target }}.tar.xz
if-no-files-found: error
retention-days: 1
macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build binary
run: cargo build --profile release-strip -p bugbite-cli
- name: Create archive
run: |
cd target/release-strip
zip $GITHUB_WORKSPACE/${{ github.ref_name }}-macos.zip bite
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ github.ref_name }}-macos
path: ${{ github.ref_name }}-macos.zip
if-no-files-found: error
retention-days: 1
publish:
if: startsWith(github.ref, 'refs/tags/')
needs: [source, linux, macos]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/*.tar.xz
artifacts/${{ github.ref_name }}-macos.zip
fail_on_unmatched_files: true