chore: Try to make the build work #2 #4
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
name: Release dev | |
on: | |
push: | |
branches: | |
- main # Stable release on main branch | |
- develop # Development release on develop branch | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
uses: ./.github/actions/npm-install | |
- name: Build assets | |
run: npm run build | |
- name: Create a release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ./* # Replace with the path to your plugin files | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Notify Packagist | |
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' | |
env: | |
PACKAGIST_USERNAME: ${{ secrets.PACKAGIST_USERNAME }} | |
PACKAGIST_TOKEN: ${{ secrets.PACKAGIST_TOKEN }} | |
run: | | |
curl -X POST -H "Content-Type: application/json" -d '{ | |
"repository": "https://github.com/haariga/craft-gonzo", | |
"package": "haariga/craft-gonzo", | |
"version": "${{ steps.create_release.outputs.tag_name }}" | |
}' https://packagist.org/api/update-package?username=$PACKAGIST_USERNAME&apiToken=$PACKAGIST_TOKEN |