mirror of
https://github.com/blueprint-community/extension-pteromonaco.git
synced 2026-02-18 19:41:53 +00:00
Add GitHub Actions workflow for release automation
Introduces a workflow to automate release creation on pushes to the main branch. The workflow extracts the version from conf.yml, builds the project using blueprint-export, creates a GitHub release with installation instructions, and uploads the generated binary as a release asset.
This commit is contained in:
49
.github/workflows/export_ext.yml
vendored
Normal file
49
.github/workflows/export_ext.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
name: Create Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Extract version from conf.yml
|
||||
id: get_version
|
||||
run: |
|
||||
VERSION=$(sed -n 's/^[[:space:]]*version:[[:space:]]*//p' conf.yml | head -n 1)
|
||||
VERSION=${VERSION//\"/}
|
||||
VERSION=${VERSION//\'/}
|
||||
echo "Detected version: $VERSION"
|
||||
echo "::set-output name=VERSION::$VERSION"
|
||||
|
||||
- name: Blueprint Build
|
||||
id: blueprint_build
|
||||
uses: zephrynis/blueprint-export@v1.0.0
|
||||
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: comnoco/create-release-action@main
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
||||
with:
|
||||
tag_name: ${{ steps.get_version.outputs.VERSION }}
|
||||
release_name: v${{ steps.get_version.outputs.VERSION }}
|
||||
body: "${{ github.event.head_commit.message }}\n\n# Steps to install\n1. Drop pteromonaco.blueprint into your pterodactyl root folder (This is usually /var/www/pterodactyl/)\n2. Run `blueprint -i pteromonaco` in the terminal"
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
- name: Upload binaries to release
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: ${{ steps.blueprint_build.outputs.FILE }}
|
||||
asset_name: ${{ steps.blueprint_build.outputs.FILE }}
|
||||
tag: ${{ steps.get_version.outputs.VERSION }}
|
||||
overwrite: true
|
||||
Reference in New Issue
Block a user