Update all non-major dependencies #1029
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: "Package mariner3d as .deb" | |
# yamllint disable-line rule:truthy | |
on: | |
push: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v2 | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Extract Debian full package version | |
run: >- | |
echo "DEBIAN_PKG_FULL_VERSION=$( | |
head -1 dist/debian/changelog | awk -F'[()]' '{print $2}' | |
)" >> $GITHUB_ENV | |
- name: Extract Debian package version | |
run: >- | |
echo "DEBIAN_PKG_VERSION=$( | |
head -1 dist/debian/changelog | | |
awk -F'[()]' '{print $2}' | | |
cut -d '-' -f 1 | |
)" >> $GITHUB_ENV | |
- name: Extract Python package version | |
run: >- | |
echo "PYTHON_PKG_VERSION=$( | |
cat pyproject.toml | grep version | awk -F'\"' '$0=$2' | |
)" >> $GITHUB_ENV | |
- name: Enforce Python package and Debian package version match | |
if: env.DEBIAN_PKG_VERSION != env.PYTHON_PKG_VERSION | |
run: exit 1 | |
- name: Fetch new list of packages | |
run: sudo apt-get update | |
- name: Install qemu | |
run: >- | |
sudo apt-get -y --no-install-recommends install binfmt-support | |
qemu-user-static | |
- name: Setup docker with qemu | |
run: >- | |
docker run --rm --privileged multiarch/qemu-user-static:register | |
--reset | |
- name: Install yarn packages | |
run: cd frontend/ && yarn install | |
- name: Build frontend assets | |
run: cd frontend/ && yarn build | |
- name: Compute Debian package name | |
run: >- | |
echo "DEBIAN_PKG_FILENAME=mariner3d_${{ | |
env.DEBIAN_PKG_FULL_VERSION | |
}}_armhf.deb" >> $GITHUB_ENV | |
- uses: satackey/[email protected] | |
continue-on-error: true | |
- name: Build Docker Image | |
run: docker build -f Dockerfile -t packager-image . | |
- name: Create docker container | |
run: docker create --name packager packager-image | |
- name: Prune dangling docker images | |
run: docker image prune -f | |
- name: Copy .deb file | |
run: >- | |
docker cp | |
packager:/build/${{ env.DEBIAN_PKG_FILENAME }} | |
${{ env.DEBIAN_PKG_FILENAME }} | |
- name: Shutdown container | |
run: docker rm -v packager | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ env.DEBIAN_PKG_FILENAME }} | |
path: ${{ env.DEBIAN_PKG_FILENAME }} | |
- name: Publish release binary | |
uses: svenstaro/upload-release-action@v1-release | |
if: github.event_name == 'release' | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ${{ env.DEBIAN_PKG_FILENAME }} | |
asset_name: ${{ env.DEBIAN_PKG_FILENAME }} | |
tag: ${{ github.ref }} | |
overwrite: true |