diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3f7879..f45851a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive @@ -25,7 +25,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive @@ -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}$ ]]; @@ -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 @@ -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 diff --git a/build/snap/snapcraft.yaml b/build/snap/snapcraft.yaml index 30c7dcd..db422ff 100644 --- a/build/snap/snapcraft.yaml +++ b/build/snap/snapcraft.yaml @@ -9,7 +9,7 @@ description: | Built from the upstream source at https://github.com/elkozmon/zoonavigator. -base: core18 +base: core22 grade: stable confinement: strict adopt-info: zoonavigator @@ -19,7 +19,7 @@ apps: command: 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 @@ -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