Skip to content

Commit

Permalink
Upgrade to new build system
Browse files Browse the repository at this point in the history
Signed-off-by: Zack Siri <[email protected]>
  • Loading branch information
zacksiri committed Nov 8, 2023
1 parent e1431c5 commit 6660bfa
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 27 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest

container:
image: alpine:3.14
image: alpine:3.18

steps:
- name: Cancel Previous Runs
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
72 changes: 51 additions & 21 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
entrypoint: /var/lib/pakman/bin/build.sh
- name: 'Build Package'
run: |
cd "$GITHUB_WORKSPACE"/.apk/"$GITHUB_REPOSITORY" || exit
- name: 'Archive'
uses: upmaru/[email protected]
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/[email protected]
- 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}}
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
elixir 1.14.2-otp-25
erlang 25.1.2
erlang 25.3.2.7
caddy 2.5.2
9 changes: 8 additions & 1 deletion instellar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
- s6
- uplink-openrc

stack: alpine/3.17
stack: alpine/3.18

build:
destinations:
Expand All @@ -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
Expand Down

0 comments on commit 6660bfa

Please sign in to comment.