Skip to content

Commit 86fbd68

Browse files
committed
Add publish GitHub Action
1 parent 1f1638d commit 86fbd68

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed

.distignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/.wordpress-org
2+
/.git
3+
/.github
4+
/node_modules
5+
6+
.distignore
7+
.gitignore

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Directories
2+
/.wordpress-org export-ignore
3+
/assets export-ignore
4+
/.github export-ignore
5+
6+
# Files
7+
/.gitattributes export-ignore
8+
/.gitignore export-ignore
9+
/README.md export-ignore

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy to WordPress.org
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
tag:
7+
name: New release
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
- name: Build
13+
run: |
14+
npm install
15+
npm run build
16+
- name: WordPress Plugin Deploy
17+
id: deploy
18+
uses: 10up/action-wordpress-plugin-deploy@stable
19+
with:
20+
generate-zip: true
21+
env:
22+
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
23+
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
24+
SLUG: simpleanalytics
25+
ASSETS_DIR: assets
26+
- name: Upload release asset
27+
uses: actions/upload-release-asset@v1
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
with:
31+
upload_url: ${{ github.event.release.upload_url }}
32+
asset_path: ${{ steps.deploy.outputs.zip-path }}
33+
asset_name: ${{ github.event.repository.name }}.zip
34+
asset_content_type: application/zip

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<a href="https://simpleanalytics.com/">
2+
<img src="https://assets.simpleanalytics.com/images/logos/logo-github-readme.png" alt="Simple Analytics logo" align="right" height="62" />
3+
</a>
4+
5+
# WordPress plugin
6+
7+
[Read our docs](https://docs.simpleanalytics.com/install-simple-analytics-on-wordpress) on the official Simple Analytics WordPress plugin.
8+
9+
# Publish
10+
11+
When publishing a new version, we automatically deploy a new version to SVN (the WordPress code repository).

0 commit comments

Comments
 (0)