Skip to content

Commit 625a507

Browse files
authored
FIX: tagging, version tracking across jobs, script execution (#20)
* FIX: typo in reference for tag name * FIX: persist cargo version check as artifact Now that we're gating the python wheel deploy on the "main" deploy step, the cargo check was returning that it's not a new version (since we publish the crate in the first step). This persists the version check result as an artifact, and then checks it in the wheel distribution steps. * FIX: make scripts executable * CHORE: bump version to 0.1.2 To test the deploy pipeline
1 parent fc8b986 commit 625a507

File tree

4 files changed

+31
-24
lines changed

4 files changed

+31
-24
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ jobs:
398398
github.git.createRef({
399399
owner: "${{ github.repository_owner }}",
400400
repo: "json-logic-rs",
401-
ref: "refs/tags/v${{ steps.get-version.ouputs.version }}",
401+
ref: "refs/tags/v${{ steps.get-version.outputs.version }}",
402402
sha: "${{ github.sha }}",
403403
})
404404
@@ -411,7 +411,7 @@ jobs:
411411
github.git.createTag({
412412
owner: "${{ github.repository_owner }}",
413413
repo: "json-logic-rs",
414-
tag: "v${{ steps.get-version.ouputs.version }}",
414+
tag: "v${{ steps.get-version.outputs.version }}",
415415
message: "Vesrion ${{ steps.get-version.outputs.version }}",
416416
object: "${{ github.sha }}",
417417
type: "commit",
@@ -438,6 +438,16 @@ jobs:
438438
echo "Cargo: ${{ steps.cargo-version.outputs.new }}"
439439
echo "NPM: ${{ steps.npm-version.outputs.new }}"
440440
441+
- name: "Persist new cargo state for subsequent jobs"
442+
shell: bash
443+
run: |
444+
echo "${{ steps.cargo-version.outputs.new }}" > tmp-new-cargo-ver
445+
446+
- uses: "actions/upload-artifact@v2"
447+
with:
448+
path: "tmp-new-cargo-ver"
449+
name: "new-cargo"
450+
441451
- name: "Cargo Publish"
442452
if: "${{ steps.cargo-version.outputs.new == 'true' }}"
443453
run: |
@@ -462,6 +472,7 @@ jobs:
462472
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
463473

464474
- name: "Pull Python Sdist Artifact"
475+
if: "${{ steps.cargo-version.outputs.new == 'true' }}"
465476
uses: "actions/download-artifact@v1"
466477
with:
467478
name: py-sdist
@@ -496,30 +507,28 @@ jobs:
496507
with:
497508
python-version: 3.8
498509

499-
# Generate the lockfile
500-
- name: "Generate Cargo Lockfile"
501-
run: "cargo generate-lockfile"
510+
- name: "Pull cargo version tracking file"
511+
uses: "actions/download-artifact@v1"
512+
with:
513+
name: "new-cargo"
514+
path: tmp-new-cargo-ver
502515

503-
- name: "Check if new Cargo version"
516+
- name: "Check for new cargo version"
504517
id: cargo-version
505518
shell: bash
506519
run: |
507-
echo "::set-output name=new::$(./scripts/newCargoVersion.sh)"
508-
509-
- name: "(DEBUG) is new cargo version"
510-
shell: bash
511-
run: |
512-
echo "${{ steps.cargo-version.outputs.new }}"
520+
echo "::set-output name=new::$(cat tmp-new-cargo-ver)"
513521
514522
- name: "Pull Python Wheels"
523+
if: "${{ steps.cargo-version.outputs.new == 'true' }}"
515524
uses: "actions/download-artifact@v1"
516525
with:
517526
name: "py-${{ matrix.python-version }}-${{ runner.os }}-wheels"
518527
path: dist-py
519528

520529
- name: "Publish Wheels"
521-
shell: bash
522530
if: "${{ steps.cargo-version.outputs.new == 'true' }}"
531+
shell: bash
523532
run: |
524533
pip install twine
525534
twine upload --skip-existing dist-py/*
@@ -551,22 +560,20 @@ jobs:
551560
with:
552561
python-version: 3.8
553562

554-
# Generate the lockfile
555-
- name: "Generate Cargo Lockfile"
556-
run: "cargo generate-lockfile"
563+
- name: "Pull cargo version tracking file"
564+
uses: "actions/download-artifact@v1"
565+
with:
566+
name: "new-cargo"
567+
path: tmp-new-cargo-ver
557568

558-
- name: "Check if new Cargo version"
569+
- name: "Check for new cargo version"
559570
id: cargo-version
560571
shell: bash
561572
run: |
562-
echo "::set-output name=new::$(./scripts/newCargoVersion.sh)"
563-
564-
- name: "(DEBUG) is new cargo version"
565-
shell: bash
566-
run: |
567-
echo "${{ steps.cargo-version.outputs.new }}"
573+
echo "::set-output name=new::$(cat tmp-new-cargo-ver)"
568574
569575
- name: "Pull Python Wheel"
576+
if: "${{ steps.cargo-version.outputs.new == 'true' }}"
570577
uses: "actions/download-artifact@v1"
571578
with:
572579
name: "py-linux-wheels-${{ matrix.manylinux.arch }}"

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ license = "MIT"
99
name = "jsonlogic-rs"
1010
readme = "README.md"
1111
repository = "https://github.com/bestowinc/json-logic-rs"
12-
version = "0.1.1"
12+
version = "0.1.2"
1313

1414
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1515

scripts/newNpmVersion.sh

100644100755
File mode changed.

scripts/newPypiVersion.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)