mirror of
https://github.com/pesde-pkg/pesde.git
synced 2025-01-08 09:09:08 +00:00
ci: attempt to fix release ci
This commit is contained in:
parent
52c502359b
commit
3810a3b9ff
1 changed files with 15 additions and 4 deletions
19
.github/workflows/release.yaml
vendored
19
.github/workflows/release.yaml
vendored
|
@ -10,16 +10,23 @@ jobs:
|
||||||
prepare:
|
prepare:
|
||||||
name: Prepare
|
name: Prepare
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
version: ${{ steps.extract_version.outputs.VERSION }}
|
||||||
|
found: ${{ steps.ensure_not_published.outputs.FOUND }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Extract version
|
- name: Extract version
|
||||||
|
id: extract_version
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(echo ${{ github.ref_name }} | cut -d'+' -f1 | cut -c 2-)
|
VERSION=$(echo ${{ github.ref_name }} | cut -d'+' -f1 | cut -c 2-)
|
||||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Ensure not published
|
- name: Ensure not published
|
||||||
|
id: ensure_not_published
|
||||||
shell: bash
|
shell: bash
|
||||||
|
env:
|
||||||
|
VERSION: ${{ steps.extract_version.outputs.VERSION }}
|
||||||
run: |
|
run: |
|
||||||
CRATE_NAME="${{ env.CRATE_NAME }}"
|
CRATE_NAME="${{ env.CRATE_NAME }}"
|
||||||
if [ ${#CRATE_NAME} -eq 1 ]; then
|
if [ ${#CRATE_NAME} -eq 1 ]; then
|
||||||
|
@ -33,7 +40,7 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FOUND=$(curl -sSL --fail-with-body "https://index.crates.io/$DIR/${{ env.CRATE_NAME }}" | jq -s 'any(.[]; .vers == "${{ env.VERSION }}")')
|
FOUND=$(curl -sSL --fail-with-body "https://index.crates.io/$DIR/${{ env.CRATE_NAME }}" | jq -s 'any(.[]; .vers == "${{ env.VERSION }}")')
|
||||||
echo "FOUND=$FOUND" >> $GITHUB_ENV
|
echo "FOUND=$FOUND" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -61,7 +68,9 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
name: Build for ${{ matrix.host }}-${{ matrix.arch }}
|
name: Build for ${{ matrix.host }}-${{ matrix.arch }}
|
||||||
needs: [ prepare ]
|
needs: [ prepare ]
|
||||||
if: ${{ env.FOUND == 'false' }}
|
if: ${{ needs.prepare.outputs.found == 'false' }}
|
||||||
|
env:
|
||||||
|
VERSION: ${{ needs.prepare.outputs.version }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
@ -122,7 +131,9 @@ jobs:
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
pull-requests: read
|
pull-requests: read
|
||||||
needs: [ publish ]
|
needs: [ prepare, publish ]
|
||||||
|
env:
|
||||||
|
VERSION: ${{ needs.prepare.outputs.version }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
|
Loading…
Reference in a new issue