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