-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add and use
setup-libmagic
Action
Signed-off-by: robot9001 <robo9k@symlink.io>
- Loading branch information
Showing
4 changed files
with
71 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: setup-libmagic | ||
description: Setup some version of `libmagic` for `magic-sys` | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
# setup cache | ||
- name: setup cache | ||
if: ${{ runner.os == 'Windows' }} | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | ||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | ||
# update packages | ||
|
||
- name: update packages | ||
if: ${{ runner.os == 'Linux' }} | ||
run: sudo apt-get update | ||
shell: bash | ||
|
||
- name: update packages | ||
if: ${{ runner.os == 'Windows' }} | ||
run: vcpkg update | ||
shell: bash | ||
|
||
- name: update packages | ||
if: ${{ runner.os == 'macOS' }} | ||
run: brew update | ||
shell: bash | ||
|
||
|
||
# install packages | ||
|
||
- name: install packages | ||
if: ${{ runner.os == 'Linux' }} | ||
run: sudo apt-get install libmagic1 libmagic-dev pkg-config | ||
shell: bash | ||
|
||
- name: install packages | ||
if: ${{ runner.os == 'Windows' }} | ||
run: vcpkg install libmagic | ||
shell: bash | ||
|
||
- name: install packages | ||
if: ${{ runner.os == 'macOS' }} | ||
run: brew install libmagic pkg-config | ||
shell: bash | ||
|
||
|
||
# setup environment | ||
|
||
- name: setup environment | ||
if: ${{ runner.os == 'Linux' }} | ||
run: echo "VCPKGRS_NO_LIBMAGIC=1" >> "${GITHUB_ENV}" | ||
shell: bash | ||
|
||
- name: setup environment | ||
if: ${{ runner.os == 'Windows' }} | ||
run: echo "LIBMAGIC_NO_PKG_CONFIG=1" >> "${GITHUB_ENV}" | ||
shell: bash | ||
|
||
- name: setup environment | ||
if: ${{ runner.os == 'macOS' }} | ||
run: echo "VCPKGRS_NO_LIBMAGIC=1" >> "${GITHUB_ENV}" | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters