Skip to content

Find latest version for GitHub release assets #251

Find latest version for GitHub release assets

Find latest version for GitHub release assets #251

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: "yarn"
cache-dependency-path: yarn.lock
- run: yarn
- run: yarn test
integration:
strategy:
matrix:
runner:
- ubuntu-latest
- macos-latest
- windows-latest
fail-fast: false
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- run: ./bin/validate-inputs
- id: setup-hlint
uses: ./
with:
name: "hlint"
version: "3.5"
url: "https://github.com/ndmitchell/{name}/releases/download/v{version}/{name}-{version}-{arch}-{os}.{ext}"
subdir: "{name}-{version}"
os-darwin: osx
os-win32: windows
arch: x86_64
- run: ls -l '${{ steps.setup-hlint.outputs.directory }}'
- if: ${{ matrix.runner != 'windows-latest' }} # it's .exe on win32
run: ls -l '${{ steps.setup-hlint.outputs.file }}'
- run: hlint --version
# Same, with inferred version
- id: setup-hlint-latest
uses: ./
with:
name: "hlint"
url: "https://github.com/ndmitchell/{name}/releases/download/v{version}/{name}-{version}-{arch}-{os}.{ext}"
subdir: "{name}-{version}"
os-darwin: osx
os-win32: windows
arch: x86_64
- run: ls -l '${{ steps.setup-hlint-latest.outputs.directory }}'
- if: ${{ matrix.runner != 'windows-latest' }} # it's .exe on win32
run: ls -l '${{ steps.setup-hlint-latest.outputs.file }}'
- run: hlint --version
- id: setup-dms
uses: ./
with:
name: dms
version: latest
url: "https://releases.deadmanssnitch.com/field-agent/{version}/{name}_{os}_{arch}.{ext}"
os-darwin: macos
os-win32: windows
arch: amd64
- run: ls -l '${{ steps.setup-dms.outputs.directory }}'
- if: ${{ matrix.runner != 'windows-latest' }}
run: ls -l '${{ steps.setup-hlint.outputs.file }}'
- run: dms --version
- id: setup-pandoc
uses: ./
with:
name: pandoc
version: 2.19.2
url: "https://github.com/jgm/{name}/releases/download/{version}/{name}-{version}-{os}-{arch}.{ext}"
url-darwin: "https://github.com/jgm/{name}/releases/download/{version}/{name}-{version}-macOS.zip"
subdir: "{name}-{version}/bin"
subdir-win32: "{name}-{version}"
os-win32: windows
arch: x86_64
arch-linux: amd64
- run: ls -l '${{ steps.setup-pandoc.outputs.directory }}'
- if: ${{ matrix.runner != 'windows-latest' }}
run: ls -l '${{ steps.setup-hlint.outputs.file }}'
- run: pandoc --version
- if: ${{ matrix.runner == 'ubuntu-latest' }}
uses: ./
with:
name: bluebook
version: 1.0.0.0
url: "https://github.com/pbrisbin/{name}/releases/download/v{version}/{name}-{os}-{arch}"
no-extract: "true"
- if: ${{ matrix.runner == 'ubuntu-latest' }}
run: bluebook --help
# Test inferring "latest"
- if: ${{ matrix.runner == 'ubuntu-latest' }}
uses: ./
with:
name: bluebook
url: "https://github.com/pbrisbin/{name}/releases/download/v{version}/{name}-{os}-{arch}"
no-extract: "true"
- if: ${{ matrix.runner == 'ubuntu-latest' }}
run: bluebook --help
#
# Random example from Freckle, that's a private repo. TODO: skip in
# forks.
#
# Skipping for now because the token has expired
# - if: ${{ matrix.runner == 'ubuntu-latest' && github.actor != 'dependabot[bot]' }}
# uses: ./
# with:
# name: platform
# version: 2.4.0.2
# url: "https://github.com/freckle/{name}/releases/download/v{version}/{name}-{arch}-{os}.{ext}"
# github-token: ${{ secrets.PLATFORM_GITHUB_TOKEN }}
# arch: x86_64
# subdir: "{name}"
# - if: ${{ matrix.runner == 'ubuntu-latest' && github.actor != 'dependabot[bot]' }}
# run: platform version