Skip to content

Commit

Permalink
ci: Fix upload rust binary action for nightly (#637)
Browse files Browse the repository at this point in the history
* ci: Fix upload rust binary action for nightly

The action requires the event to be triggered by a tag, which does not
happen for nightlies. In this case we need to manually specify the ref.

* ci: Include the git-diffsitter wrapper

These used to be in the releases before I switched to the new action.

* ci: Use the prod profile in CD

The upload rust action now allows you to specify a specific profile.
  • Loading branch information
afnanenayet authored May 21, 2023
1 parent d1764b8 commit 0da818c
Showing 1 changed file with 29 additions and 11 deletions.
40 changes: 29 additions & 11 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,26 +197,44 @@ jobs:
release_version="$(cat ./artifacts/release-version)"
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
- uses: taiki-e/upload-rust-binary-action@v1
# For nightly releases we need to manually specify the tag because the
# action was triggered by a schedule not a tag.

# TODO: separate out the logic so we have another action that creates and
# pushes the tag so this file doesn't have to handle that logic. What we
# really should do is simply have this job get triggered by tags and
# have some way to specify whether it's a prerelease tag and handle it
# from there.
- name: Upload Rust binaries for nightly
uses: taiki-e/upload-rust-binary-action@v1
if: github.event.inputs.tag_name == 'nightly'
with:
bin: diffsitter
archive: $bin-$target
# (required) GitHub token for uploading assets to GitHub Releases.
token: ${{ secrets.GITHUB_TOKEN }}
tar: unix
zip: windows
checksum: sha256
target: ${{ matrix.job.target }}
ref: refs/tags/nightly
include: bin/git-diffsitter
profile: production

- name: Upload Rust binaries for release
uses: taiki-e/upload-rust-binary-action@v1
if: github.event.inputs.tag_name != 'nightly'
with:
# (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
# Note that glob pattern is not supported yet.
bin: diffsitter
# (optional) Archive name (non-extension portion of filename) to be uploaded.
# [default value: $bin-$target]
# [possible values: the following variables and any string]
# variables:
# - $bin - Binary name (non-extension portion of filename).
# - $target - Target triple.
# - $tag - Tag of this release.
# When multiple binary names are specified, default archive name or $bin variable cannot be used.
archive: $bin-$target
# (required) GitHub token for uploading assets to GitHub Releases.
token: ${{ secrets.GITHUB_TOKEN }}
tar: unix
zip: windows
checksum: sha256
target: ${{ matrix.job.target }}
include: bin/git-diffsitter
profile: production

- name: Install cargo deb
uses: taiki-e/install-action@v2
Expand Down

0 comments on commit 0da818c

Please # to comment.