Skip to content

Commit

Permalink
fix(CI): Fixed release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
seebeen committed Nov 1, 2024
1 parent d772da1 commit e347029
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 11 deletions.
38 changes: 27 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: Release
name: CI
on:
workflow_dispatch:
push:
branches:
- master
- develop
- alpha
- beta

jobs:
release:
name: Release
Expand All @@ -13,13 +16,26 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.OBLAK_BOT_TOKEN }}
- name: Publish a composer package
uses: better-php-actions/publish-composer-package@v1
token: ${{ secrets.OBLAKBOT_PAT }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
id: gpg
with:
package_slug: "wp-plugin-installer"
package_name: "WP Plugin Installer"
with_gpg: true
gpg_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
release_token: ${{ secrets.OBLAK_BOT_TOKEN }}
gpg_private_key: ${{ secrets.OBLAKBOT_GPG_KEY }}
passphrase: ${{ secrets.OBLAKBOT_GPG_PASS }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
with:
extra_plugins: |
conventional-changelog-conventionalcommits
@semantic-release/github
@semantic-release/exec
env:
GIT_AUTHOR_NAME: ${{ steps.gpg.outputs.name}}
GIT_AUTHOR_EMAIL: ${{ steps.gpg.outputs.email}}
GIT_COMMITTER_NAME: ${{ steps.gpg.outputs.name}}
GIT_COMMITTER_EMAIL: ${{ steps.gpg.outputs.email}}
GITHUB_TOKEN: ${{ secrets.OBLAKBOT_PAT }}
31 changes: 31 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"branches": [
"master",
{
"name": "beta",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/exec",
{
"prepareCmd": "zip -r '/tmp/release.zip' ./src README.md ./composer.json"
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "/tmp/release.zip",
"name": "wp-plugin-installer-v${nextRelease.version}.zip",
"label": "WP Plugin Installer v${nextRelease.version}"
}
]
}
]
]
}

0 comments on commit e347029

Please sign in to comment.