e672c1251e1b26c7886efe033d2dac58aab9b6b4
[akkoma] / .woodpecker / .release.yml
1 variables:
2 - &scw-secrets
3 - SCW_ACCESS_KEY
4 - SCW_SECRET_KEY
5 - SCW_DEFAULT_ORGANIZATION_ID
6 - &setup-scw-s3 "wget https://github.com/scaleway/scaleway-cli/releases/download/v2.5.1/scaleway-cli_2.5.1_linux_amd64 && mv scaleway-cli_2.5.1_linux_amd64 scaleway-cli && chmod +x scaleway-cli && ./scaleway-cli object config install type=rclone"
7
8 - &setup-hex "mix local.hex --force && mix local.rebar --force"
9 - &build-on
10 when:
11 event:
12 - push
13 - tag
14 branch:
15 - develop
16 - stable
17 - refs/tags/v*
18 - refs/tags/stable-*
19 - &tag-build 'export BUILD_TAG=$${CI_COMMIT_TAG:-"$CI_COMMIT_BRANCH"} && export PLEROMA_BUILD_BRANCH=$BUILD_TAG'
20
21 - &clean "(rm -rf release || true) && (rm -rf _build || true) && (rm -rf /root/.mix) && (rm scaleway-cli || true) && (mix deps.clean --all || true)"
22
23
24 pipeline:
25 glibc:
26 image: elixir:1.13
27 <<: *build-on
28 secrets: *scw-secrets
29 environment:
30 MIX_ENV: prod
31 commands:
32 - apt-get update && apt-get install -y cmake libmagic-dev rclone zip imagemagick libmagic-dev git
33 - *clean
34 - *setup-scw-s3
35 - echo "import Mix.Config" > config/prod.secret.exs
36 - *setup-hex
37 - *tag-build
38 - mix deps.get --only prod
39 - mix release --path release
40 - zip akkoma-${tag}.zip -r release
41 - rclone copyto akkoma-${tag}.zip scaleway:akkoma-updates/$BUILD_TAG/akkoma-${tag}.zip
42
43 musl:
44 image: elixir:1.13-alpine
45 <<: *build-on
46 secrets: *scw-secrets
47 environment:
48 MIX_ENV: prod
49 commands:
50 - apk add git gcc g++ musl-dev make cmake file-dev rclone wget zip imagemagick
51 - *clean
52 - *setup-scw-s3
53 - *setup-hex
54 - *tag-build
55 - mix deps.get --only prod
56 - mix release --path release
57 - zip akkoma-${tag}.zip -r release
58 - rclone copyto akkoma-${tag}.zip scaleway:akkoma-updates/$BUILD_TAG/akkoma-${tag}-musl.zip