From 6660bfa4fa5bed58c2b5e2601f861ba4e080b0a8 Mon Sep 17 00:00:00 2001 From: Zack Siri Date: Wed, 8 Nov 2023 15:46:24 +0700 Subject: [PATCH] Upgrade to new build system Signed-off-by: Zack Siri --- .github/workflows/ci.yml | 9 ++-- .github/workflows/deployment.yml | 72 ++++++++++++++++++++++---------- .tool-versions | 2 +- instellar.yml | 9 +++- 4 files changed, 65 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43720bde..508161ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest container: - image: alpine:3.14 + image: alpine:3.18 steps: - name: Cancel Previous Runs @@ -50,13 +50,14 @@ jobs: mix deps.get mix deps.compile mix dialyzer --plt + static_code_analysis: name: Static Code Analysis needs: deps runs-on: ubuntu-latest container: - image: alpine:3.14 + image: alpine:3.18 steps: - name: Cancel Previous Runs @@ -97,11 +98,11 @@ jobs: runs-on: ubuntu-latest container: - image: alpine:3.14 + image: alpine:3.18 services: postgres: - image: postgres:11.5 + image: postgres:15.4 env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 88e98b59..5846d06b 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -8,43 +8,73 @@ on: - completed jobs: - build_and_deploy: - name: Build and Deploy - runs-on: ubuntu-20.04 + build: + name: Build + runs-on: ubuntu-latest if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - name: 'Checkout' - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.workflow_run.head_branch }} fetch-depth: 0 - - name: 'Pakman' - uses: upmaru/pakman@alpine-3.17-7.4 + - name: Setup Pakman + uses: upmaru/pakman@v8 with: - command: 'bootstrap' + alpine: v3.18 + + - name: Bootstrap Configuration + run: | + pakman bootstrap + shell: alpine.sh {0} env: ABUILD_PRIVATE_KEY: ${{secrets.ABUILD_PRIVATE_KEY}} ABUILD_PUBLIC_KEY: ${{secrets.ABUILD_PUBLIC_KEY}} - - name: 'Build APK' - uses: upmaru/pakman@alpine-3.17-7.4 - with: - entrypoint: /var/lib/pakman/bin/build.sh + - name: 'Build Package' + run: | + cd "$GITHUB_WORKSPACE"/.apk/"$GITHUB_REPOSITORY" || exit - - name: 'Archive' - uses: upmaru/pakman@alpine-3.17-7.4 + abuild snapshot + abuild -r + shell: alpine.sh {0} + + - name: Upload Artifact + uses: actions/upload-artifact@v3 with: - entrypoint: /var/lib/pakman/bin/archive.sh + name: ${{ runner.arch }} + path: /home/runner/packages + + deploy: + name: Deploy + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 - - name: 'Create Deployment' - uses: upmaru/pakman@alpine-3.17-7.4 + - uses: actions/download-artifact@v3 + with: + path: /home/runner/artifacts + + - name: Setup Pakman + uses: upmaru/pakman@v8 with: - command: 'create_deployment' - archive: 'packages.zip' + alpine: v3.18 + + - name: Merge Artifact + run: | + cp -R /home/runner/artifacts/X64/. /home/runner/packages/ + sudo zip -r /home/runner/packages.zip "$HOME"/packages + shell: alpine.sh {0} + + - name: Push + run: pakman push + shell: alpine.sh {0} env: - WORKFLOW_REF: ${{ github.event.workflow_run.head_branch }} - WORKFLOW_SHA: ${{ github.event.workflow_run.head_sha }} - INSTELLAR_ENDPOINT: ${{secrets.INSTELLAR_ENDPOINT}} + WORKFLOW_REF: ${{ github.ref }} + WORKFLOW_SHA: ${{ github.sha }} + INSTELLAR_ENDPOINT: https://web.instellar.app INSTELLAR_PACKAGE_TOKEN: ${{secrets.INSTELLAR_PACKAGE_TOKEN}} INSTELLAR_AUTH_TOKEN: ${{secrets.INSTELLAR_AUTH_TOKEN}} diff --git a/.tool-versions b/.tool-versions index 69be381c..ba11a508 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ elixir 1.14.2-otp-25 -erlang 25.1.2 +erlang 25.3.2.7 caddy 2.5.2 diff --git a/instellar.yml b/instellar.yml index 5e5aa048..98528803 100644 --- a/instellar.yml +++ b/instellar.yml @@ -11,7 +11,7 @@ dependencies: - s6 - uplink-openrc -stack: alpine/3.17 +stack: alpine/3.18 build: destinations: @@ -31,6 +31,13 @@ run: - name: migrate binary: uplink call: 'eval Uplink.Release.Tasks.migrate' + - name: console + binary: uplink + call: remote + - name: logs + binary: tail + path: /usr/bin + call: -f -n 100 /var/log/uplink/current services: - name: web binary: uplink