fix: Fix step order

This commit is contained in:
Ginger 2025-09-08 12:25:21 -04:00
commit d3c88c6242
No known key found for this signature in database

View file

@ -32,31 +32,6 @@ jobs:
echo "distribution=$DISTRIBUTION" >> $GITHUB_OUTPUT echo "distribution=$DISTRIBUTION" >> $GITHUB_OUTPUT
echo "Debian distribution: $DISTRIBUTION ($VERSION)" echo "Debian distribution: $DISTRIBUTION ($VERSION)"
- name: Get package revision and component
id: package-meta
run: |
BASE_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r ".packages[] | select(.name == \"conduwuit\").version" | sed 's/~/-/g')
# VERSION is the package version, COMPONENT is used in
# apt's repository config like a git repo branch
if [[ "${{ forge.ref }}" == "refs/tags/"* ]]; then
COMPONENT="stable"
VERSION=$BASE_VERSION
else
SHA=$(echo "${{ forge.sha }}" | cut -c1-7)
DATE=$(date +%Y%M%d)
if [ "${{ forge.ref_name }}" = "main" ]; then
COMPONENT="dev"
else
# Use sanitized ref name for the component
COMPONENT=$(echo "${{ forge.ref_name }}" | sed 's/[^a-zA-Z0-9]/-/g' | tr '[:upper:]' '[:lower:]' | cut -c1-30)
fi
VERSION="$BASE_VERSION~git$DATE.$SHA-$COMPONENT"
fi
echo "component=$COMPONENT" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Component: $COMPONENT"
echo "Version: $VERSION"
- name: Checkout repository with full history - name: Checkout repository with full history
uses: https://code.forgejo.org/actions/checkout@v4 uses: https://code.forgejo.org/actions/checkout@v4
with: with:
@ -90,6 +65,31 @@ jobs:
rust-version: nightly rust-version: nightly
github-token: ${{ secrets.GH_PUBLIC_RO }} github-token: ${{ secrets.GH_PUBLIC_RO }}
- name: Get package revision and component
id: package-meta
run: |
BASE_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r ".packages[] | select(.name == \"conduwuit\").version" | sed 's/~/-/g')
# VERSION is the package version, COMPONENT is used in
# apt's repository config like a git repo branch
if [[ "${{ forge.ref }}" == "refs/tags/"* ]]; then
COMPONENT="stable"
VERSION=$BASE_VERSION
else
SHA=$(echo "${{ forge.sha }}" | cut -c1-7)
DATE=$(date +%Y%M%d)
if [ "${{ forge.ref_name }}" = "main" ]; then
COMPONENT="dev"
else
# Use sanitized ref name for the component
COMPONENT=$(echo "${{ forge.ref_name }}" | sed 's/[^a-zA-Z0-9]/-/g' | tr '[:upper:]' '[:lower:]' | cut -c1-30)
fi
VERSION="$BASE_VERSION~git$DATE.$SHA-$COMPONENT"
fi
echo "component=$COMPONENT" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Component: $COMPONENT"
echo "Version: $VERSION"
- name: Check cargo-deb version - name: Check cargo-deb version
id: cargo-deb-version id: cargo-deb-version
run: echo "version=$(curl -s \"https://index.crates.io/ca/rg/cargo-deb\" | tail -n1 | jq -r .vers)" >> $GITHUB_OUTPUT run: echo "version=$(curl -s \"https://index.crates.io/ca/rg/cargo-deb\" | tail -n1 | jq -r .vers)" >> $GITHUB_OUTPUT