Skip to content

Commit

Permalink
Manually install repositories and keys
Browse files Browse the repository at this point in the history
  • Loading branch information
gerlero committed Oct 18, 2024
1 parent 3efd979 commit d16a66b
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 36 deletions.
50 changes: 14 additions & 36 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,60 +15,38 @@ runs:
- name: Prepare
id: prep
run: |
sudo() {
if [ $(id -u) -eq 0 ]; then
"$@"
else
command sudo "$@"
fi
}
if [ $(uname) == "Darwin" ]; then
brew tap gerlero/openfoam
echo "openfoam-app-version=$(brew info gerlero/openfoam/openfoam | head -n 1 | awk '{print $3}')" >> "$GITHUB_OUTPUT"
echo "openfoam-etc=/Applications/OpenFOAM-v${{ inputs.openfoam-version }}.app/Contents/Resources/etc" >> "$GITHUB_OUTPUT"
elif [ ${{ inputs.openfoam-version }} -lt 1000 ]; then
which wget && which add-apt-repository || echo "apt-packages-pre=wget software-properties-common" >> $GITHUB_OUTPUT
sudo apt-get update && sudo apt-get install -y gnupg ca-certificates
sudo apt-key add $GITHUB_ACTION_PATH/gpg.key
sudo bash -c "echo \"deb [arch=$(dpkg --print-architecture)] https://dl.openfoam.org/ubuntu $(sed -ne 's/^VERSION_CODENAME=//p' /etc/os-release) main\" > /etc/apt/sources.list.d/openfoam.list"
echo "apt-packages=openfoam${{ inputs.openfoam-version }}" >> $GITHUB_OUTPUT
echo "openfoam-etc=/opt/openfoam${{ inputs.openfoam-version }}/etc" >> "$GITHUB_OUTPUT"
else
which wget || echo "apt-packages-pre=wget gnupg" >> $GITHUB_OUTPUT
sudo apt-get update && sudo apt-get install -y gnupg ca-certificates
sudo apt-key add $GITHUB_ACTION_PATH/pubkey.gpg
sudo bash -c "echo \"deb [arch=$(dpkg --print-architecture)] https://dl.openfoam.com/repos/deb $(sed -ne 's/^VERSION_CODENAME=//p' /etc/os-release) main\" > /etc/apt/sources.list.d/openfoam.list"
echo "apt-packages=openfoam${{ inputs.openfoam-version }}-default" >> $GITHUB_OUTPUT
echo "openfoam-etc=/usr/lib/openfoam/openfoam${{ inputs.openfoam-version }}/etc" >> "$GITHUB_OUTPUT"
fi
shell: bash
- name: Install prerequisites
if: steps.prep.outputs.apt-packages-pre
uses: gerlero/apt-install@v1
with:
packages: ${{ steps.prep.outputs.apt-packages-pre }}
cache: ${{ inputs.cache && inputs.cache != 'false' }}
- name: Add OpenFOAM APT repository (openfoam.org)
if: steps.prep.outputs.apt-packages && inputs.openfoam-version < 1000
run: |
sudo() {
if [ $(id -u) -eq 0 ]; then
"$@"
else
command sudo "$@"
fi
}
sudo wget -O /etc/apt/trusted.gpg.d/openfoam.asc https://dl.openfoam.org/gpg.key
sudo add-apt-repository http://dl.openfoam.org/ubuntu
shell: bash
- name: Add OpenFOAM APT repository (openfoam.com)
if: steps.prep.outputs.apt-packages && inputs.openfoam-version >= 1000
run: |
sudo() {
if [ $(id -u) -eq 0 ]; then
"$@"
else
command sudo "$@"
fi
}
wget -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash
shell: bash
- name: Install OpenFOAM on Linux
if: steps.prep.outputs.apt-packages
uses: gerlero/apt-install@v1
with:
packages: ${{ steps.prep.outputs.apt-packages }}
install-recommends: false
update: ${{ inputs.openfoam-version < 1000 }}
cache: ${{ inputs.cache && inputs.cache != 'false' }}
- name: Restore OpenFOAM on macOS from cache
if: runner.os == 'macOS' && inputs.cache && inputs.cache != 'false'
Expand Down
30 changes: 30 additions & 0 deletions gpg.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1

mQENBFeGXxcBCACpBHAlBk67MVnHtLux0eI/gJuo5eTSLzQd4TYXgLbOXs8aCEH1
7JKAS24m2KwtcqBwTfW+wb54b0HHzJn81Zpmd7JXt/6oX4wZHTXMED9/P893UHOI
sC5e1O9BzDQ4J1Ot4SMMRElNZyxdcbqGTvp+t67xrBqG1ZoXO4WYfUemNT+I4xrs
xzguKVvL+yWB8hHZ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IwPuhO
5FMihCMmnsESjCgzrP6rVDOma4psf7fwEe8m1cltl8gVQ1cZIo2LO/0XnbBeo9b9
hA+RqtKz9IZYqNzbvGxEbkhMf6O/TDSFmJpAueh8D3/Dgcrvya0bflkwoGl7RDKu
Iq68v4Ri1s4LAq8RCIsB85NKds2vLIAuMrhbhtwYEVgalPotMMHX/MMrKL5T95Ac
/GuySu+Yk7kmfrFq0SIzP1BFGv+l84ke18zMu0ssGHVGY0eaEEpO2aude+HhMJqD
+PmSM0ZDHsJu4It2PIIGtgGWfai9ddXOI2+z8W6ugsKr/tq7Sik=
=DlyX
-----END PGP PUBLIC KEY BLOCK-----
30 changes: 30 additions & 0 deletions pubkey.gpg
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: signing for openfoam.com packages

mQINBF6fBMQBEACqRTvEOYTj/c9VdywKrT8k59YWzMokpS78HsItpzPClH+inVSI
mXlW9vu8AFr+pBMNBVxIIgVJtc44cPsIR5O1rLoDqrjGO0PmTv9ayQZyVttav8u1
8CM/NB8oNFpxzyQpx0nKByJmQSwd5W+aDQc5rf7EW43FGIiNS19xVhqizYbfurMt
0hFZ9LSTEBkjElIu91nxIxBNPq7xjzFbCFx2qKvQU9asbzP1SMF7k8l/e3WLQnWl
SkDnO0ElPYPhuRXNY1y74/c0eGrsyOfKmBtA/7NjJP9MlB1OXqYMuxLnOPi0EsXz
sw9XtAV36cBc0OMrqfkiodmlR9Bqy+wQSCigvFRdidVjDMO5PBq4pcVjcqBXhCGU
6EQ5mB5L9LI7qYUiZclkPSEgXcz02tTxC1SsjqVIScF/v1GPhuGupwj2RKpF+XXR
bebMSdYqiqs8oBkQdGYEPujt/CTBxjxRrDJYxqyhEZ5D8j3u66K0EJ/isGTJadzg
RbV67qWidjsh5Gs2rhzoyRXCAY04YXBNES7tTNw0gY1GvkqdH86jkk6y7gHzWOoe
R6KK2gNM0SccTUgMqgKg51KI2clXdjOCSR9lFCO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