Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test latest lychee version tag #236

Merged
merged 7 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ jobs:
with:
lycheeVersion: nightly

- name: test latest lychee version
uses: ./
with:
lycheeVersion: latest

- name: test globs
uses: ./
with:
Expand Down
53 changes: 25 additions & 28 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,6 @@ runs:
mkdir -p "$HOME/.local/bin"
shell: bash

- name: Determine lychee filename
id: lychee-filename
run: |
# Older releases (prior to 0.16.x) had the version number in the archive name.
# This determines the correct filename based on the version string.
if [[ '${{ inputs.lycheeVersion }}' =~ ^v0\.0|^v0\.1[0-5]\. ]]; then
echo "filename=lychee-${{ inputs.lycheeVersion }}-x86_64-unknown-linux-gnu.tar.gz" >> $GITHUB_OUTPUT
echo "tag=${{ inputs.lycheeVersion }}" >> $GITHUB_OUTPUT
else
echo "filename=lychee-x86_64-unknown-linux-gnu.tar.gz" >> $GITHUB_OUTPUT
# Each crate in the workspace has its own tag, so we need to specify the tag for the binary.
# The binary is released under the 'lychee' tag, the library under 'lychee-lib'.
# For nightly builds, we use the 'nightly' tag.
if [[ '${{ inputs.lycheeVersion }}' == 'nightly' ]]; then
echo "tag=${{ inputs.lycheeVersion }}" >> $GITHUB_OUTPUT
else
echo "tag=lychee-${{ inputs.lycheeVersion }}" >> $GITHUB_OUTPUT
fi
fi
shell: bash

- name: Clean up existing lychee files
run: |
# Remove any existing lychee binaries or archives to prevent conflicts
Expand All @@ -82,14 +61,32 @@ runs:
rm -f "${{ steps.lychee-filename.outputs.filename }}"
shell: bash

- name: Download lychee
- name: Download and extract lychee
id: lychee-setup
run: |
curl -sfLO "https://github.com/lycheeverse/lychee/releases/download/${{ steps.lychee-filename.outputs.tag }}/${{ steps.lychee-filename.outputs.filename }}"
shell: bash
# Determine filename and download URL based on version
if [[ '${{ inputs.lycheeVersion }}' =~ ^v0\.0|^v0\.1[0-5]\. ]]; then
FILENAME="lychee-${{ inputs.lycheeVersion }}-x86_64-unknown-linux-gnu.tar.gz"
DOWNLOAD_URL="https://github.com/lycheeverse/lychee/releases/download/${{ inputs.lycheeVersion }}/${FILENAME}"
else
FILENAME="lychee-x86_64-unknown-linux-gnu.tar.gz"
if [[ '${{ inputs.lycheeVersion }}' == 'nightly' ]]; then
DOWNLOAD_URL="https://github.com/lycheeverse/lychee/releases/download/nightly/${FILENAME}"
elif [[ '${{ inputs.lycheeVersion }}' == 'latest' ]]; then
DOWNLOAD_URL="https://github.com/lycheeverse/lychee/releases/latest/download/${FILENAME}"
else
DOWNLOAD_URL="https://github.com/lycheeverse/lychee/releases/download/lychee-${{ inputs.lycheeVersion }}/${FILENAME}"
fi
fi

- name: Extract lychee
run: |
tar -xvzf "${{ steps.lychee-filename.outputs.filename }}"
echo "Downloading from: ${DOWNLOAD_URL}"
curl -sfLO "${DOWNLOAD_URL}"

echo "Extracting ${FILENAME}"
tar -xvzf "${FILENAME}"

# Output filename for use in later steps
echo "filename=${FILENAME}" >> $GITHUB_OUTPUT
shell: bash

- name: Install lychee
Expand All @@ -100,7 +97,7 @@ runs:
- name: Clean up installation files
run: |
# Remove the downloaded archive and any unnecessary files after installation
rm -f "${{ steps.lychee-filename.outputs.filename }}"
rm -f "${{ steps.lychee-setup.outputs.filename }}"
shopt -s extglob
rm -f lychee*!(lychee-bin|lychee-lib)
shell: bash
Expand Down
Loading