Skip to content

ci: fix package script #46

ci: fix package script

ci: fix package script #46

Workflow file for this run

name: Release
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- next
- next-major
- beta
- alpha
workflow_dispatch:
env:
php-version: '8.3'
build-node-version: 20
jobs:
####################
# Semantic release
####################
# semantic:
# if: github.event_name != 'pull_request'
# uses: monicahq/workflows/.github/workflows/release.yml@v2
# with:
# semantic_version: 23
# secrets:
# GH_TOKEN_RELEASE: ${{ secrets.GH_TOKEN_RELEASE }}
package:
# needs: semantic
runs-on: ubuntu-latest
name: Package release
# if: needs.semantic.outputs.new_release_published == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# ref: v${{ needs.semantic.outputs.new_release_version }}
ref: v5.0.0-beta.4
- name: Download changelog file
uses: actions/download-artifact@v4
with:
name: changelog
run-id: 8937613632
github-token: ${{ secrets.GH_DOWNLOAD_TOKEN }}
- name: Setup PHP ${{ env.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.php-version }}
coverage: none
# Composer
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer files
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ env.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ env.php-version }}-${{ hashFiles('**/composer.lock') }}
${{ runner.os }}-composer-${{ env.php-version }}
${{ runner.os }}-composer-
# Yarn
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.build-node-version }}
cache: yarn
- name: Import key
run: echo -e "$GPG_KEY" | gpg --batch --yes --import -
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
- name: Create package
id: package
# run: scripts/ci/package.sh 'v${{ needs.semantic.outputs.new_release_version }}' $GITHUB_SHA
run: scripts/ci/package.sh 'v5.0.0-beta.4' $GITHUB_SHA
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }}
- name: Publish package
# run: |
# for f in {${{ steps.package.outputs.package }},${{ steps.package.outputs.assets }}}{,.asc,.sha512,.sha512.asc}; do
# echo "Uploading release file '$f'…"
# gh release upload 'v${{ needs.semantic.outputs.new_release_version }}' "$f" --clobber
# done
run: |
for f in {${{ steps.package.outputs.package }},${{ steps.package.outputs.assets }}}{,.asc,.sha512,.sha512.asc}; do
echo "Uploading release file '$f'…"
gh release upload 'v5.0.0-beta.4' "$f" --clobber
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Store package
uses: actions/upload-artifact@v4
with:
name: package
path: ${{ steps.package.outputs.package }}
- name: Store assets
uses: actions/upload-artifact@v4
with:
name: assets
path: ${{ steps.package.outputs.assets }}
docker-workflow:
# needs: [semantic, package]
needs: [package]
runs-on: ubuntu-latest
name: Docker release create
# if: needs.semantic.outputs.new_release_published == 'true'
steps:
- name: Dispatch docker release
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Release update
repo: monicahq/docker
ref: refs/heads/main
token: ${{ secrets.DOCKER_GITHUB_TOKEN }}