Skip to content

Commit

Permalink
chore(release): update cargo-dist to 0.4.0 (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Oct 27, 2023
1 parent 77d4556 commit ea45734
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 27 deletions.
41 changes: 16 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ permissions:
on:
push:
tags:
- "**[0-9]+.[0-9]+.[0-9]+*"
- '**[0-9]+.[0-9]+.[0-9]+*'
pull_request:

jobs:
Expand All @@ -58,7 +58,7 @@ jobs:
with:
submodules: recursive
- name: Install cargo-dist
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.3.1/cargo-dist-installer.sh | sh"
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.4.0/cargo-dist-installer.sh | sh"
- id: plan
run: |
cargo dist plan ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }} --output-format=json > dist-manifest.json
Expand Down Expand Up @@ -92,6 +92,7 @@ jobs:
runs-on: ${{ matrix.runner }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -100,20 +101,12 @@ jobs:
- name: Install cargo-dist
run: ${{ matrix.install_dist }}
- name: Install dependencies
if: matrix.runner == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y \
--no-install-recommends \
--allow-unauthenticated \
libasound2-dev \
libxi-dev \
libxtst-dev \
pkg-config
${{ matrix.packages_install }}
- name: Build artifacts
run: |
# Actually do builds and make zips and whatnot
cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
cargo dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
echo "cargo dist ran successfully"
- id: cargo-dist
name: Post-build
Expand All @@ -126,11 +119,15 @@ jobs:
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
- name: "Upload artifacts"
uses: actions/upload-artifact@v3
with:
name: artifacts
path: ${{ steps.cargo-dist.outputs.paths }}
path: |
${{ steps.cargo-dist.outputs.paths }}
${{ env.BUILD_MANIFEST_NAME }}
# Build and package all the platform-agnostic(ish) things
upload-global-artifacts:
Expand All @@ -142,18 +139,8 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
--no-install-recommends \
--allow-unauthenticated \
libasound2-dev \
libxi-dev \
libxtst-dev \
pkg-config
- name: Install cargo-dist
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.3.1/cargo-dist-installer.sh | sh"
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.4.0/cargo-dist-installer.sh | sh"
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
- name: Fetch local artifacts
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -187,7 +174,7 @@ jobs:
- name: print tag
run: echo "ok we're publishing!"

# Create a Github Release with all the results once everything is done,
# Create a Github Release with all the results once everything is done
publish-release:
needs: [plan, should-publish]
runs-on: ubuntu-latest
Expand All @@ -202,6 +189,10 @@ jobs:
with:
name: artifacts
path: artifacts
- name: Cleanup
run: |
# Remove the granular manifests
rm artifacts/*-dist-manifest.json
- name: Create Release
uses: ncipollo/release-action@v1
with:
Expand Down
10 changes: 8 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ lto = "thin"
# Config for 'cargo dist'
[workspace.metadata.dist]
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
cargo-dist-version = "0.3.1"
cargo-dist-version = "0.4.0"
# CI backends to support
ci = ["github"]
# The installers to generate for each app
Expand All @@ -91,9 +91,15 @@ targets = [
]
# Publish jobs to run in CI
pr-run-mode = "upload"
# Ignore out-of-date contents
# Skip checking whether the specified configuration files are up to date
allow-dirty = ["ci", "msi"]

[workspace.metadata.dist.dependencies.apt]
libasound2-dev = '*'
libxi-dev = '*'
libxtst-dev = '*'
pkg-config = '*'

[package.metadata.wix]
upgrade-guid = "51610A8E-55C9-4F49-8C9F-3529499D5C60"
path-guid = "2198A7FB-5F3C-4FAB-B253-2314115AD2DD"

0 comments on commit ea45734

Please sign in to comment.