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