Skip to content

Version 3.1.0

Version 3.1.0 #142

Workflow file for this run

# Note: see https://github.com/overhangio/tutor/releases for a well-developed release schedule
# We could use a CHANGELOG generator to forward information about changes...
name: Sparrow release generation
on:
push:
tags:
- 'v*.*.*'
jobs:
build_test:
# Note: for deployment, we move to an older version of Ubuntu
# https://pyinstaller.readthedocs.io/en/stable/usage.html
runs-on: ubuntu-20.04
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Update submodules
run: git submodule update --init
- uses: actions/setup-python@v4
with:
python-version: '3.9'
# Bundling (note: we build the CLI in Docker to support older Linux platforms)
# 2023-04-07: We had to fall back to a standard build (for modern platforms)
# because the cdrx/docker-pyinstaller image has not been updated with new CA certificates.
- name: Bundle command-line application with PyInstaller
# run: make build-linux && sudo make install-dist
run: make build && sudo make install-dist
- name: Check version consistency
run: SPARROW_PATH=$(pwd) sparrow dev check-version --exact
- name: Run Sparrow tests for built application
run: sparrow test
- name: Zip up command-line application
# For zipping, change directory to the dist directory.
run: tar -czv -f sparrow-Linux-x86_64.tar.gz -C _cli/dist/sparrow .
- uses: actions/upload-artifact@v2
with:
name: sparrow-Linux-x86_64.tar.gz
path: sparrow-Linux-x86_64.tar.gz
retention-days: 1
if-no-files-found: error
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: backend_meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/earthcubegeochron/sparrow/backend
tags: |
type=match,pattern=v(.*),group=1
type=pep440,pattern={{version}}
- name: Build and push backend
uses: docker/build-push-action@v2
with:
context: backend
push: true
tags: ${{ steps.backend_meta.outputs.tags }}
labels: ${{ steps.backend_meta.outputs.labels }}
cache-from: type=registry,ref=ghcr.io/earthcubegeochron/sparrow/backend:latest
cache-to: type=inline
- name: Extract metadata (tags, labels) for Docker
id: frontend_meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/earthcubegeochron/sparrow/frontend
tags: |
type=match,pattern=v(.*),group=1
type=pep440,pattern={{version}}
- name: Build and push frontend
uses: docker/build-push-action@v2
with:
context: frontend
push: true
tags: ${{ steps.frontend_meta.outputs.tags }}
labels: ${{ steps.frontend_meta.outputs.labels }}
cache-from: type=registry,ref=ghcr.io/earthcubegeochron/sparrow/frontend:latest
cache-to: type=inline
build_cli_darwin:
# Note: for deployment, we might need to move to an older version of Ubuntu
# https://pyinstaller.readthedocs.io/en/stable/usage.html
runs-on: macOS-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Update submodules
run: git submodule update --init
- uses: actions/setup-python@v2
with:
python-version: '3.9'
# Bundling
- name: Bundle command-line application with PyInstaller
run: make build && sudo make install
# Cannot run tests on Mac because Docker doesn't run on MacOS in Github Actions
- name: Zip up command-line application
run: tar -czv -f sparrow-Darwin-x86_64.tar.gz -C _cli/dist/sparrow .
- uses: actions/upload-artifact@v2
with:
name: sparrow-Darwin-x86_64.tar.gz
path: sparrow-Darwin-x86_64.tar.gz
retention-days: 1
if-no-files-found: error
create_release:
needs: [build_test, build_cli_darwin]
# Note: for deployment, we might need to move to an older version of Ubuntu
# https://pyinstaller.readthedocs.io/en/stable/usage.html
runs-on: ubuntu-latest
steps:
- name: Get built Sparrow CLI (Linux)
uses: actions/download-artifact@v2
with:
name: sparrow-Linux-x86_64.tar.gz
- name: Get built Sparrow CLI (Darwin)
uses: actions/download-artifact@v2
with:
name: sparrow-Darwin-x86_64.tar.gz
- name: Get version information and set prerelease status
id: get-version
run: |
echo ::set-output name=tag_name::${GITHUB_REF/refs\/tags\//}
if ${{ contains(github.ref, '.beta') || contains(github.ref, '.dev') || contains(github.ref, '.rc') }} ; then
echo ::set-output name=is_prerelease::true
echo ::set-output name=prerelease_text::Since this is a prerelease, the you must install it specifically
else
echo ::set-output name=is_prerelease::false
echo ::set-output name=prerelease_text::If you want to install this release specifically, you can add it to the above command
fi
# We create the release only if things work both on Linux and Darwin
# Note: see https://github.com/overhangio/tutor/releases for a well-developed release schedule
- name: Create release
id: create_release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ steps.get-version.outputs.tag_name }}
name: Sparrow ${{ steps.get-version.outputs.tag_name }}
draft: false
# Set prerelease status based on tag name
prerelease: ${{ steps.get-version.outputs.is_prerelease }}
fail_on_unmatched_files: true
body: |
The latest release of Sparrow can be installed using the following command:
```
bash -c "$(curl -fsSL https://sparrow-data.org/get-sparrow.sh)"
```
If you are already running Sparrow version `2.1.0` or above, an in-place upgrade is possible:
```sparrow update```
${{ steps.get-version.outputs.prerelease_text }}, like so: `bash -c $(...) - ${{ steps.get-version.outputs.tag_name }}`.
## Advanced installation
- You can download the [`get-sparrow.sh`](https://github.com/EarthCubeGeochron/Sparrow/blob/HEAD/get-sparrow.sh) script manually and run it using `bash get-sparrow.sh` or `bash get-sparrow.sh ${{ steps.get-version.outputs.tag_name }}`.
- For complete control over the installation process, you can manually review the [`get-sparrow.sh` script](https://github.com/EarthCubeGeochron/Sparrow/blob/HEAD/get-sparrow.sh) and run the download and installation steps yourself.
See the [Getting started documentation](https://sparrow-data.org/docs/getting-started) for more information on how to set up Sparrow.
files: |
sparrow-Linux-x86_64.tar.gz
sparrow-Darwin-x86_64.tar.gz