-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add release job to CI * Rename .github/workflow/release.yml to .github/workflows/release.yml * Update release.yml * Update release.yml * Update release.yml * Update release.yml * Update release.yml
- Loading branch information
1 parent
6c1b514
commit ad4a813
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: "Publish release" | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
release: | ||
name: "Publish release" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: "Checkout code" | ||
uses: "actions/checkout@v2" | ||
|
||
- name: "Setup PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: "7.1" | ||
|
||
- name: "Install dependencies" | ||
run: "composer update --no-interaction --no-dev --prefer-dist" | ||
|
||
- name: "Determine tag" | ||
id: "determine_git_tag" | ||
shell: "bash" | ||
run: echo "::set-output name=tag_name::${GITHUB_REF/refs\/tags\//}" | ||
|
||
- name: "Create directory structure" | ||
run: | | ||
mkdir wp-rest-api-auth0 | ||
cp -r LICENSE README.md wp-rest-api-auth0.php vendor/ wp-rest-api-auth0/ | ||
- name: "Create ZIP file" | ||
run: "zip -r -9 wp-rest-api-auth0.zip wp-rest-api-auth0-loader.php wp-rest-api-auth0/" | ||
|
||
- name: "Upload ZIP as release asset" | ||
uses: "svenstaro/upload-release-action@v2" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
tag: "${{ github.ref }}" | ||
file: "wp-rest-api-auth0.zip" | ||
asset_name: "wp-rest-api-auth0-${{ steps.determine_git_tag.outputs.tag_name }}.zip" | ||
overwrite: true |