-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new-feature: create binaries with GitHub Actions (#142)
Co-authored-by: Renaud <[email protected]> Co-authored-by: renaudjester <[email protected]>
- Loading branch information
1 parent
4c633fe
commit 839a9a3
Showing
3 changed files
with
149 additions
and
0 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,58 @@ | ||
name: Create Binaries | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- 'pre-releases/**' | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [windows-latest, macos-latest, ubuntu-latest, macos-13] | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 20 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
|
||
- name: Install dependencies | ||
id: set-version | ||
run: | | ||
make build-and-prepare-for-binary | ||
- name: Build with PyInstaller | ||
run: | | ||
make run-using-pyinstaller-${{ matrix.os }} | ||
- name: Upload binaries to windows | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
$WIN_VERSION = poetry version --short | ||
gh release upload v$WIN_VERSION dist/copernicusmarine.exe#copernicusmarine-binary-windows-for-v$WIN_VERSION | ||
- name: Upload binaries to macos or ubuntu | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
if: matrix.os != 'windows-latest' | ||
run: | | ||
if [ "${{ matrix.os }}" == "macos-latest" ]; then | ||
ARCH="macos-arm64" | ||
elif [ "${{ matrix.os }}" == "macos-13" ]; then | ||
ARCH="macos-x86_64" | ||
elif [ "${{ matrix.os }}" == "ubuntu-latest" ]; then | ||
ARCH="linux" | ||
fi | ||
gh release upload v${{steps.set-version.outputs.VERSION}} dist/copernicusmarine_${ARCH}.cli#copernicusmarine-binary-${ARCH}-for-v${{steps.set-version.outputs.VERSION}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
=================================================== | ||
Installing Copernicus Marine Toolbox | ||
=================================================== | ||
|
||
There are several ways to install or use the Copernicus Marine Toolbox: | ||
|
||
* via pip `pypi`_ | ||
* via conda `conda-forge`_ | ||
* via docker `dockerhub`_ | ||
|
||
Alternatively, you can use a binary. | ||
|
||
Via pip | ||
************** | ||
|
||
.. code-block:: bash | ||
pip install copernicusmarine | ||
.. note:: Requires Python 3.9 or higher. | ||
|
||
Via conda (conda-forge channel) | ||
****************************************** | ||
|
||
.. code-block:: bash | ||
conda install -c conda-forge copernicusmarine | ||
Via docker | ||
************** | ||
|
||
.. code-block:: bash | ||
docker run -it copernicusmarine/copernicusmarine | ||
Create an account on Copernicus Marine website | ||
*********************************************** | ||
|
||
To be able to use the Copernicus Marine Toolbox, you need to have an account on the Copernicus Marine website. You can create an account here `copernicusmarine-register`_. | ||
|
||
.. _pypi: https://pypi.org/project/copernicusmarine/ | ||
.. _conda-forge: https://anaconda.org/conda-forge/copernicusmarine | ||
.. _dockerhub: https://hub.docker.com/r/copernicusmarine/copernicusmarine | ||
.. _copernicusmarine-register: https://data.marine.copernicus.eu/register | ||
|
||
Use the CopernicusMarine Toolbox binaries | ||
*********************************************** | ||
|
||
In the `release page <https://github.com/mercator-ocean/copernicus-marine-toolbox/releases>`_ you can access the binaries of the latest releases. Once downloaded for the specific platform, you can use the toolbox by running the binary as follows: | ||
|
||
In mac-os or linux: | ||
|
||
.. code-block:: bash | ||
./copernicusmarine_macos-latest.cli describe | ||
(``describe`` or any other command) | ||
|
||
You might have to update the permissions of the binary to be able to execute it with linux: | ||
|
||
.. code-block:: bash | ||
chmod +rwx cmt_ubuntu-latest.cli | ||
And from a Windows os (cmd): | ||
|
||
.. code-block:: bash | ||
copernicusmarine_windows-latest.exe describe | ||
(``describe`` or any other command) |