Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
elkozmon committed Jul 27, 2024
1 parent e811f28 commit 117fc38
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 30 deletions.
45 changes: 23 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -25,7 +25,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -49,14 +49,10 @@ jobs:
build_date: ${{ steps.set_vars.outputs.build_date }}

steps:
- name: Get version
id: get_version
uses: battila7/get-version-action@v2

- id: set_vars
name: Set variables
run: |
tag="${{ steps.get_version.outputs.version-without-v }}"
tag="${GITHUB_REF_NAME#v}"
# is this a semver release?
if [[ "${tag}" =~ ^[0-9]+(\.[0-9]+){2,3}$ ]];
Expand Down Expand Up @@ -91,18 +87,18 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Build Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
context: .
file: ${{ github.workspace }}/build/docker/Dockerfile
Expand Down Expand Up @@ -130,31 +126,36 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Download jars
uses: actions/download-artifact@v1
with:
name: jars

- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1
with:
use_lxd: true

- name: Snap Build
- name: Prepare source
run: |
echo "$APP_VERSION" \
echo "${{ needs.setup_env.outputs.app_version }}" \
> ${GITHUB_WORKSPACE}/build/snap/local/version
tar \
-xvf ${GITHUB_WORKSPACE}/jars/jars.tar.gz \
-C ${GITHUB_WORKSPACE}/build/snap/local
cd ${GITHUB_WORKSPACE}/build
sg lxd -c 'snapcraft snap --use-lxd -o zoonavigator_amd64.snap'
- id: build_snap
name: Build Snap
uses: snapcore/action-build@v1
with:
path: build/
snapcraft-args: --verbosity=debug

snapcraft upload --release=${{ needs.setup_env.outputs.snap_channel }} build/zoonavigator_amd64.snap
- name: Publish Snap
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
with:
snap: ${{ steps.build_snap.outputs.snap }}
release: ${{ needs.setup_env.outputs.snap_channel }}

cleanup:
runs-on: ubuntu-latest
Expand Down
14 changes: 6 additions & 8 deletions build/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ description: |
Built from the upstream source at https://github.com/elkozmon/zoonavigator.
base: core18
base: core22
grade: stable
confinement: strict
adopt-info: zoonavigator

apps:
zoonavigator:
command: zoonavigator
command: bin/zoonavigator
daemon: simple
environment:
JAVA_HOME: $SNAP/usr/lib/jvm/java-11-openjdk-$SNAP_ARCH
JAVA_HOME: $SNAP/usr/lib/jvm/java-17-openjdk-$SNAP_ARCH
PATH: $JAVA_HOME/bin:$PATH
plugs:
- network
Expand All @@ -33,14 +33,12 @@ parts:
bin/configure: snap/hooks/configure
parse-info: []
override-pull: |
snapcraftctl pull
snapcraftctl set-version $(cat version)
craftctl default
craftctl set version=$(cat version)
build-packages:
- ca-certificates
- ca-certificates-java
stage:
- -usr/lib/jvm/java-11-openjdk-amd64/lib/security/blacklisted.certs
stage-packages:
- openjdk-11-jdk-headless
- openjdk-17-jdk-headless
- krb5-user
- jq

0 comments on commit 117fc38

Please sign in to comment.