]> git.mxchange.org Git - friendica.git/blob - .woodpecker/.releaser.yml
de0d6ba0e5498436c9a4797f026c9166a05b7435
[friendica.git] / .woodpecker / .releaser.yml
1 matrix:
2   include:
3     - PHP_MAJOR_VERSION: 7.4
4       PHP_VERSION: 7.4.18
5
6 depends_on:
7   - phpunit
8   - code_standards_check
9
10 platform: releaser/release # This prevents executing this pipeline at other servers than ci.friendi.ca
11
12 pipeline:
13   restore_cache:
14     image: meltwater/drone-cache:dev
15     settings:
16       backend: "filesystem"
17       restore: true
18       cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
19       archive_format: "gzip"
20       mount:
21         - '.composer'
22     volumes:
23       - /tmp/drone-cache:/tmp/cache
24     when:
25       repo: friendica/friendica
26       branch: stable
27       event: tag
28   composer_install:
29     image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
30     commands:
31       - export COMPOSER_HOME=.composer
32       - composer validate
33       - composer install --no-dev --optimize-autoloader
34     when:
35       repo: friendica/friendica
36       branch: stable
37       event: tag
38   create_artifacts:
39     image: debian
40     commands:
41       - apt-get update
42       - apt-get install bzip2
43       - mkdir ./build
44       - export VERSION="$(cat VERSION)"
45       - export RELEASE="friendica-full-$VERSION"
46       - export ARTIFACT="$RELEASE.tar.gz"
47       - tar
48         --transform "s,^,$RELEASE/,"
49         -X mods/release-list-exclude.txt
50         -T mods/release-list-include.txt
51         -cvzf ./build/$ARTIFACT
52       - cd ./build
53       - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256"
54       - chmod 664 ./*
55       - ls -lh
56       - cat "$ARTIFACT.sum256"
57       - sha256sum "$ARTIFACT"
58     when:
59       repo: friendica/friendica
60       branch: stable
61       event: tag
62   sign_artifacts:
63     image: plugins/gpgsign
64     settings:
65       key:
66         from_secret: gpg_key
67       passphrase:
68         from_secret: gpg_password
69       files:
70         - build/*
71       exclude:
72         - build/*.sum256
73       detach_sign: true
74     when:
75       repo: friendica/friendica
76       branch: stable
77       event: tag
78   upload_artifacts:
79     image: alpine
80     secrets:
81       - source: sftp_host
82         target: lftp_host
83       - source: sftp_user
84         target: lftp_user
85       - source: ssh_key
86         target: lftp_key
87     environment:
88       LFTP_PORT: "22"
89       LFTP_SOURCE: "build"
90       LFTP_TARGET: "/http"
91     volumes:
92       - /etc/hosts:/etc/hosts
93     commands:
94       - apk add lftp openssh openssl
95       - touch drone.key
96       - chmod 400 drone.key
97       - echo "$LFTP_KEY" | openssl base64 -A -d > drone.key
98       - lftp -c "
99         set net:timeout 5;
100         set net:max-retries 2;
101         set net:reconnect-interval-base 5;
102         set sftp:auto-confirm true;
103         set sftp:connect-program 'ssh -q -a -x -i drone.key';
104         connect sftp://$LFTP_USER:@$LFTP_HOST:$LFTP_PORT;
105         cd $LFTP_TARGET;
106         mput $LFTP_SOURCE/*;
107         "
108       - rm drone.key
109     when:
110       repo: friendica/friendica
111       branch: stable
112       event: tag