rbxcloud icon indicating copy to clipboard operation
rbxcloud copied to clipboard

Confirm Cargo Version matches Tag Version in release CI/CD workflow

Open FxllenCode opened this issue 3 years ago • 9 comments

Resolves #3

Done:

  • Find the cargo version from the Cargo.toml file.
  • Add a v to the version within the workflow.
  • Cancel the workflow if the two do not match up.

Todo:

  • Figure out why github.ref is not returning the current tag.
  • Complete the semi-automation of releases in the CI workflow.

If I can figure out why I cannot get the tag using github.ref, everything else should be pretty much done from there.

Thanks!

FxllenCode avatar Jul 30 '22 02:07 FxllenCode

P.S. I'll squash the commits if that's easier for you - was annoying to test the workflows out without commiting! :joy:

FxllenCode avatar Jul 30 '22 02:07 FxllenCode

Thanks for the work on this! I'll test this out later and then merge it in.

Sleitnick avatar Aug 01 '22 13:08 Sleitnick

Thanks for the work on this! I'll test this out later and then merge it in.

Just to clarify - this is still a draft pr. I've been struggling to get the tag name from the CI. I tried with github.ref and it did not work as intended.

FxllenCode avatar Aug 01 '22 14:08 FxllenCode

If it helps, this is how I do it in my other project: https://github.com/Sleitnick/Knit/blob/main/.github/workflows/release.yaml#L48 ${GITHUB_REF#refs/tags/}

Sleitnick avatar Aug 01 '22 16:08 Sleitnick

So maybe it could look something like this?

      - name: Get the tag of current release
        id: get_version
        run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}

      - name: Verify package version is equal to tag version
        if: ${{ steps.cargo_version.outputs.value != steps.get_version.outputs.VERSION }}
        run: |
          echo "${{ steps.cargo_version.outputs.value }}"
          echo "${{ steps.get_version.outputs.VERSION }}"
          exit 1

Sleitnick avatar Aug 01 '22 16:08 Sleitnick

If you wanna make those changes, I'll pull this in!

Sleitnick avatar Aug 11 '22 14:08 Sleitnick

Hey sorry about that @Sleitnick will get to it ASAP!

FxllenCode avatar Aug 11 '22 14:08 FxllenCode

No problem; no rush

Sleitnick avatar Aug 11 '22 17:08 Sleitnick

Hm @Sleitnick... I still could not get it implemented with the changes you requests, you should be able to add a commit re if you want to take a stab at seeing what's wrong here.

FxllenCode avatar Aug 11 '22 17:08 FxllenCode