Release #29
Workflow file for this run
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
name: Release | |
# Do this on every push with a version tag | |
on: | |
push: | |
tags: | |
- "v*" | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-linux-release: | |
name: Build release for Linux | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Build cfitsio | |
run: | | |
# Install dependencies | |
curl "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-3.49.tar.gz" -o cfitsio.tar.gz | |
tar -xf cfitsio.tar.gz | |
rm cfitsio.tar.gz | |
cd cfitsio-3.49 | |
# Enabling SSE2/SSSE3 could cause portability problems, but it's unlikely that anyone | |
# is using such a CPU... | |
# https://stackoverflow.com/questions/52858556/most-recent-processor-without-support-of-ssse3-instructions | |
# Disabling curl just means you cannot fits_open() using a URL. | |
CFLAGS="-O3" ./configure --prefix=/usr/local --enable-reentrant --enable-sse2 --enable-ssse3 --disable-curl | |
make -j | |
sudo make install | |
sudo ldconfig | |
cd .. | |
- name: Build mwalib release | |
run: MWALIB_LINK_STATIC_CFITSIO=1 cargo build --release | |
- name: Create release tarball | |
run: | | |
mv target/release/libmwalib.{a,so} include/mwalib.h . | |
tar -acvf mwalib-$(git describe --tags)-linux_x86_64.tar.gz LICENSE LICENSE-cfitsio CHANGELOG.md libmwalib.{a,so} mwalib.h | |
- name: Upload tarball | |
uses: actions/upload-artifact@v2 | |
with: | |
name: linux.tar.gz | |
path: "*.tar.gz" | |
if-no-files-found: error | |
build-macos-release: | |
name: Build release for MacOS | |
runs-on: macos-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Build cfitsio | |
run: | | |
# Install dependencies | |
curl "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-3.49.tar.gz" -o cfitsio.tar.gz | |
tar -xf cfitsio.tar.gz | |
rm cfitsio.tar.gz | |
cd cfitsio-3.49 | |
# Enabling SSE2/SSSE3 could cause portability problems, but it's unlikely that anyone | |
# is using such a CPU... | |
# https://stackoverflow.com/questions/52858556/most-recent-processor-without-support-of-ssse3-instructions | |
# Disabling curl just means you cannot fits_open() using a URL. | |
CFLAGS="-O3" ./configure --prefix=/usr/local --enable-reentrant --enable-sse2 --enable-ssse3 --disable-curl | |
sudo make shared | |
sudo make install | |
cd .. | |
- name: Build mwalib release | |
run: MWALIB_LINK_STATIC_CFITSIO=1 cargo build --release | |
- name: Create release tarball | |
run: | | |
mv target/release/libmwalib.{a,dylib} include/mwalib.h . | |
tar -acvf mwalib-$(git describe --tags)-macosx.tar.gz LICENSE LICENSE-cfitsio CHANGELOG.md libmwalib.{a,dylib} mwalib.h | |
- name: Upload tarball | |
uses: actions/upload-artifact@v2 | |
with: | |
name: macos.tar.gz | |
path: "*.tar.gz" | |
if-no-files-found: error | |
create-release: | |
name: Create a new release | |
runs-on: ubuntu-latest | |
needs: [build-linux-release, build-macos-release] | |
steps: | |
- name: Download Linux artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: linux.tar.gz | |
- name: Download Linux artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: macos.tar.gz | |
- name: Provide new release asset | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: true | |
files: | | |
*.tar.gz |