update ubuntu container #190
Workflow file for this run
This file contains hidden or 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: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- 'master' | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
name: Run Checks and Build | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
- os: ubuntu-latest | |
container: ubuntu:20.04 | |
- os: macos-latest | |
runs-on: ${{ matrix.os }} | |
container: ${{ matrix.container }} | |
steps: | |
- name: Install build dependencies (Ubuntu container) | |
if: matrix.container == 'ubuntu:20.04' | |
run: | | |
apt-get update && apt-get install -y build-essential git p7zip-full gcc | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
ssh-key: ${{ secrets.SSH_KEY }} | |
- name: Run convbin build | |
working-directory: app/consapp/convbin/gcc | |
run: | | |
make clean all test | |
if: runner.os != 'Windows' | |
- name: Run convbin build | |
working-directory: app/consapp/convbin/gcc | |
run: | | |
make clean all | |
if: runner.os == 'Windows' | |
- name: Run str2str build | |
working-directory: app/consapp/str2str/gcc | |
run: | | |
make clean all | |
- name: Archive ${{ runner.os }} Binaries. | |
shell: bash | |
run: | | |
POSTFIX=""; | |
if [[ "${{ runner.os }}" == "Windows" ]]; then | |
POSTFIX=".exe"; | |
fi | |
VERSION="${GITHUB_REF##*/}" | |
DATE="$(date '+%Y-%m-%d')" | |
SBP2RINEX="sbp2rinex${POSTFIX}" | |
STR2STR="str2str${POSTFIX}" | |
cp ./app/consapp/convbin/gcc/$SBP2RINEX $SBP2RINEX | |
cp ./app/consapp/str2str/gcc/$STR2STR $STR2STR | |
RELEASE_ARCHIVE="swiftnav_rtklib-${VERSION}-${{ runner.os }}.zip" | |
7z a -tzip $RELEASE_ARCHIVE $SBP2RINEX $STR2STR LICENSE.txt; | |
echo $RELEASE_ARCHIVE >release-archive.filename | |
echo "RELEASE_ARCHIVE=$(cat release-archive.filename)" >>$GITHUB_ENV | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ runner.os }}-artifacts | |
path: | | |
${{ env.RELEASE_ARCHIVE }} | |
release-archive.filename | |
release: | |
name: Create Release | |
needs: | |
- build | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Store git tag and date vars. | |
run: | | |
DATE="$(date '+%Y-%m-%d')"; | |
echo "DATE=${DATE}" >> $GITHUB_ENV | |
echo "VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- name: Pull Windows Installer | |
uses: actions/download-artifact@v4 | |
with: | |
name: Windows-artifacts | |
path: Windows | |
- name: Pull macOS Installer | |
uses: actions/download-artifact@v4 | |
with: | |
name: macOS-artifacts | |
path: macOS | |
- name: Pull Linux Installer | |
uses: actions/download-artifact@v4 | |
with: | |
name: Linux-artifacts | |
path: Linux | |
- name: Prepare Release | |
shell: bash | |
run: | | |
echo "WINDOWS_ARCHIVE=$(cat Windows/release-archive.filename)" >>$GITHUB_ENV | |
echo "LINUX_ARCHIVE=$(cat Linux/release-archive.filename)" >>$GITHUB_ENV | |
echo "MACOS_ARCHIVE=$(cat macOS/release-archive.filename)" >>$GITHUB_ENV | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: "${{ env.VERSION }}-${{ env.DATE }}" | |
files: | | |
Windows/${{ env.WINDOWS_ARCHIVE }} | |
Linux/${{ env.LINUX_ARCHIVE }} | |
macOS/${{ env.MACOS_ARCHIVE }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish: | |
needs: [release] | |
runs-on: ubuntu-latest | |
name: Publish | |
steps: | |
- name: Store git tag vars | |
shell: bash | |
run: echo "VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- uses: swift-nav/swift-cli-publisher@v2 | |
env: | |
VERSION: "${{ env.VERSION }}" | |
DL_MAC: "swiftnav_rtklib-${{ env.VERSION }}-macOS.zip" | |
DL_WINDOWS: "swiftnav_rtklib-${{ env.VERSION }}-Windows.zip" | |
DL_LINUX: "swiftnav_rtklib-${{ env.VERSION }}-Linux.zip" | |
TOOLS: "str2str,sbp2rinex" | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
gh-name: ${{ secrets.GH_NAME }} | |
gh-email: ${{ secrets.GH_EMAIL }} |