Skip to content

Commit 32c0123

Browse files
ci(after release): Add after release action triggered by release action [skip ci]
1 parent eb60ed4 commit 32c0123

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

.github/workflows/end-to-end-release-zip.yml renamed to .github/workflows/after-release.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
name: End-to-end release test
1+
name: After release test
22
on:
3-
push:
4-
branches:
5-
- main
6-
paths-ignore:
7-
- '**.md'
8-
schedule:
9-
- cron: '25 08 * * *'
3+
release:
4+
types: [ published ]
105
workflow_dispatch:
116
inputs:
127
debug_enabled:
@@ -48,7 +43,6 @@ jobs:
4843
env:
4944
EXTENSION_NAME: "CrowdSec_Bouncer"
5045
EXTENSION_PATH: "crowdsec-bouncer"
51-
ORIGIN: "https://github.com/crowdsecurity/cs-wordpress-bouncer"
5246

5347
steps:
5448

@@ -112,16 +106,16 @@ jobs:
112106
path: my-own-modules/${{ env.EXTENSION_PATH }}
113107

114108
- name: Copy only expected zipped files from HEAD
115-
if: github.event_name == 'push' || github.event.inputs.check_head_zip == 'true'
109+
if: github.event.inputs.check_head_zip == 'true'
116110
run : |
117111
mkdir wp-content/plugins/crowdsec
118112
rsync -rc --exclude-from="my-own-modules/${{ env.EXTENSION_PATH }}/.distignore" "my-own-modules/${{ env.EXTENSION_PATH }}/" wp-content/plugins/crowdsec/ --delete --delete-excluded
119113
ls -al wp-content/plugins/crowdsec
120114
121115
- name: Retrieve last stable release zip
122-
if: github.event_name != 'push' && github.event.inputs.check_head_zip != 'true'
116+
if: github.event.inputs.check_head_zip != 'true'
123117
run : |
124-
LAST_TAG=$(curl -Ls -o /dev/null -w %{url_effective} ${{ env.ORIGIN }}/releases/latest | grep -oP "\/tag\/v\K(.*)$")
118+
LAST_TAG=$(curl -Ls -o /dev/null -w %{url_effective} $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/latest | grep -oP "\/tag\/v\K(.*)$")
125119
curl -fL https://downloads.wordpress.org/plugin/crowdsec.$LAST_TAG.zip -o crowdsec.$LAST_TAG.zip
126120
unzip crowdsec.$LAST_TAG.zip -d ${{ github.workspace }}/wp-content/plugins
127121

.github/workflows/end-to-end-test-suite.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: End-to-end test suite
22
on:
3+
push:
4+
branches:
5+
- main
6+
paths-ignore:
7+
- '**.md'
38
workflow_dispatch:
49

510
permissions:

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ jobs:
141141
if: github.event.inputs.deploy_to_wordpress == 'true'
142142
uses: softprops/action-gh-release@v1
143143
with:
144+
token: ${{ secrets.CS_RELEASE_TOKEN }}
144145
files: crowdsec.zip
145146
body_path: CHANGELOG.txt
146147
name: ${{ env.VERSION_NUMBER }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
This WordPress plugin allows you to apply decisions from CrowdSec directly within the WordPress application.
66

77
![Version](https://img.shields.io/github/v/release/crowdsecurity/cs-wordpress-bouncer?include_prereleases)
8-
[![End-to-end release ZIP test](https://github.com/crowdsecurity/cs-wordpress-bouncer/actions/workflows/end-to-end-release-zip.yml/badge.svg)](https://github.com/crowdsecurity/cs-wordpress-bouncer/actions/workflows/end-to-end-release-zip.yml)
8+
[![End-to-end test](https://github.com/crowdsecurity/cs-wordpress-bouncer/actions/workflows/end-to-end-test-suite.yml/badge.svg)](https://github.com/crowdsecurity/cs-wordpress-bouncer/actions/workflows/end-to-end-test-suite.yml)
99
![Licence](https://img.shields.io/github/license/crowdsecurity/cs-wordpress-bouncer)
1010

1111

0 commit comments

Comments
 (0)