Skip to content

Commit

Permalink
Merge pull request #175 from blinemedical/VIDEO-2688-add-override-url…
Browse files Browse the repository at this point in the history
…-for-windows

[VIDEO-2688] - Install Windows MSIs from custom source
  • Loading branch information
saraboule authored Mar 14, 2024
2 parents 9febe00 + 37b625b commit 0a05bd9
Show file tree
Hide file tree
Showing 16 changed files with 27,752 additions and 133 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,11 @@ jobs:
matrix:
os: ['windows-2019', 'windows-2022', 'macos-12', 'ubuntu-20.04']
arch: ['x86', 'x86_64']
buildSource: [true, false]
exclude:
- os: 'macos-12'
arch: 'x86'
- os: 'ubuntu-20.04'
arch: 'x86'
- os: 'macos-12'
buildSource: true
- os: 'ubuntu-20.04'
buildSource: false

steps:
- uses: actions/checkout@v4
Expand All @@ -44,15 +39,11 @@ jobs:
with:
python-version: '3.x'

- name: Install Meson and Ninja Dependencies for Windows
if: matrix.os == 'windows-2019' || matrix.os == 'windows-2022'
run: pip install setuptools meson ninja

- name: Setup GStreamer with default version
uses: ./
with:
arch: ${{ matrix.arch }}
forceBuildFromSource: ${{ matrix.buildSource }}
version: '1.22.9'

- name: Run gst-inspect --version
run: |
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ The architecture (`x86`, `x86_64`, etc.) of binaries to install. Defaults to `x

The URL from where to clone the gstreamer source (Linux targets only). Defaults to `https://gitlab.freedesktop.org/gstreamer/gstreamer.git`.

**WINDOWS ONLY:**

### `msiUrl`

An optional override url for downloading the Windows gstreamer runtime MSI installer. If not specified, the default is `https://gstreamer.freedesktop.org/data/pkg/windows/<version>/gstreamer-1.0-<arch>-<version>.msi`. If this input is specified then the action post run will be run and gstreamer will be uninstalled. These are primarily meant to be used in self hosted runners and not run in the gstreamer hosted runners that are bootstrapped and executed as non-persistent containers.

### `devMsiUrl`

An optional override url for downloading the Windows gstreamer development libraries and tools MSI installer. If not specified, the default is `https://gstreamer.freedesktop.org/data/pkg/windows/<version>/gstreamer-1.0-devel-<arch>-<version>.msi`.
If the msiUrl is specified, the devMsiUrl must also be specified.

### `buildRun`

An optional value that, if supplied, will separate the gstreamer installation path from other gstreamer installations. The environment variables will be updated to reflect the newest installation.

## Outputs

### `gstreamerPath`
Expand Down
16 changes: 11 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ inputs:
description: 'the location of the source repository'
required: false
default: 'https://gitlab.freedesktop.org/gstreamer/gstreamer.git'
forceBuildFromSource:
description: 'whether to force building from source instead of using installer package'
required: false
default: 'false'
gstreamerOptions:
description: 'The option configuration string for buliding GStreamer from source'
required: false
Expand All @@ -45,9 +41,19 @@ inputs:
-Dgst-plugins-good:cairo=enabled
-Dgst-plugins-good:soup=enabled
-Dgst-plugins-good:soup-lookup-dep=true
msiUrl:
description: 'Optional override of the URL from which to download the Windows runtime msi installer'
required: false
devMsiUrl:
description: 'Optional override of the URL from which to download the Windows development libraries msi installer'
required: false
buildRun:
description: 'Optional input with the run number for the workflow'
required: false
outputs:
gstreamerPath:
description: 'Installation path'
runs:
using: 'node20'
main: 'dist/index.js'
main: 'dist/main/index.js'
post: 'dist/post/index.js'
28 changes: 28 additions & 0 deletions cleanup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const core = require('@actions/core');
const exec = require('@actions/exec');

async function cleanup() {
if (process.platform === 'win32') {
const msiUrl = core.getInput('msiUrl');

if (msiUrl) {

const arch = core.getInput('arch');
const version = core.getInput('version');

const installers = [
`gstreamer-1.0-msvc-${arch}-${version}.msi`,
`gstreamer-1.0-devel-msvc-${arch}-${version}.msi`,
];

for (const installer of installers) {
await exec.exec('msiexec', [
'/passive',
'/x',
installer,
]);
await io.rmRF(installer);
}
}
}
}
1 change: 0 additions & 1 deletion dist/index.js.map

This file was deleted.

122 changes: 65 additions & 57 deletions dist/index.js → dist/main/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/main/index.js.map

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 0a05bd9

Please sign in to comment.