|
| 1 | +version: 2.1 |
| 2 | +# |
| 3 | +# Copyright (c) 2023 Robert Di Pardo <dipardo.r@gmail.com> |
| 4 | +# |
| 5 | +# This Source Code Form is subject to the terms of the Mozilla Public |
| 6 | +# License, v. 2.0. If a copy of the MPL was not distributed with this file, |
| 7 | +# You can obtain one at https://mozilla.org/MPL/2.0/. |
| 8 | +# |
| 9 | +orbs: |
| 10 | + lazarus: rdipardo/lazarus@2 |
| 11 | + win: circleci/windows@5 |
| 12 | + |
| 13 | +references: |
| 14 | + executor: &executor |
| 15 | + executor: |
| 16 | + name: win/default |
| 17 | + shell: bash.exe |
| 18 | + development: &development |
| 19 | + filters: |
| 20 | + tags: |
| 21 | + only: /v.*/ |
| 22 | + production: &production |
| 23 | + filters: |
| 24 | + branches: |
| 25 | + ignore: /.*/ |
| 26 | + tags: |
| 27 | + only: /v.*/ |
| 28 | + |
| 29 | +jobs: |
| 30 | + build: |
| 31 | + <<: *executor |
| 32 | + environment: |
| 33 | + UPX_VER: 4.0.2 |
| 34 | + steps: |
| 35 | + - checkout |
| 36 | + - run: |
| 37 | + name: Clone submodules |
| 38 | + command: | |
| 39 | + git reset --hard |
| 40 | + git submodule sync --recursive |
| 41 | + git submodule update -f --init --remote --checkout --recursive |
| 42 | + - run: |
| 43 | + name: Install UPX |
| 44 | + command: | |
| 45 | + curl -sLO "https://github.com/upx/upx/releases/download/v$UPX_VER/upx-$UPX_VER-win64.zip" |
| 46 | + 7z e upx-$UPX_VER-win64.zip -o"$WINDIR" |
| 47 | + upx.exe --version |
| 48 | + - lazarus/install: |
| 49 | + win32: true |
| 50 | + - run: |
| 51 | + name: Build and Pack |
| 52 | + command: make_release.cmd |
| 53 | + shell: cmd.exe |
| 54 | + - persist_to_workspace: |
| 55 | + root: . |
| 56 | + paths: out |
| 57 | + |
| 58 | + push-release: |
| 59 | + <<: *executor |
| 60 | + parameters: |
| 61 | + plugin-name: |
| 62 | + type: string |
| 63 | + default: HTMLTag |
| 64 | + |
| 65 | + steps: |
| 66 | + - checkout |
| 67 | + - attach_workspace: |
| 68 | + at: . |
| 69 | + - store_artifacts: |
| 70 | + name: Upload << parameters.plugin-name >>_<< pipeline.git.tag >>.zip |
| 71 | + path: out/<< parameters.plugin-name >>_<< pipeline.git.tag >>.zip |
| 72 | + destination: << parameters.plugin-name >>_<< pipeline.git.tag >>.zip |
| 73 | + - store_artifacts: |
| 74 | + name: Upload << parameters.plugin-name >>_<< pipeline.git.tag >>_x64.zip |
| 75 | + path: out/<< parameters.plugin-name >>_<< pipeline.git.tag >>_x64.zip |
| 76 | + destination: << parameters.plugin-name >>_<< pipeline.git.tag >>_x64.zip |
| 77 | + - run: |
| 78 | + name: Create GitHub Release |
| 79 | + command: bash.exe .circleci/scripts/gh_release.sh |
| 80 | + environment: |
| 81 | + SLUGX86: << parameters.plugin-name >>_<< pipeline.git.tag >>.zip |
| 82 | + SLUGX64: << parameters.plugin-name >>_<< pipeline.git.tag >>_x64.zip |
| 83 | + BIN_DIR: out |
| 84 | + |
| 85 | +workflows: |
| 86 | + lazarus-build: |
| 87 | + jobs: |
| 88 | + - build: |
| 89 | + <<: *development |
| 90 | + - push-release: |
| 91 | + <<: *production |
| 92 | + requires: [build] |
0 commit comments