Skip to content

v1.0.6

v1.0.6 #11

Workflow file for this run

name: Build & Release
on:
release:
types: [ published ]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
tools: composer:v2
coverage: none
- name: Install Dependencies
run: |
composer install --no-dev --prefer-dist
- name: Set Version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Build Binary
run: php harbor app:build --build-version=${{ env.RELEASE_VERSION }}
- name: Automatic Release
uses: actions/github-script@v3
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
const fs = require("fs").promises;
const { repo: { owner, repo }, sha } = context;
const release = await github.repos.getReleaseByTag({
owner, repo,
tag: process.env.GITHUB_REF.replace("refs/tags/", ""),
});
await github.repos.uploadReleaseAsset({
owner, repo,
name: "harbor",
data: await fs.readFile("./builds/harbor"),
release_id: release.data.id,
});