mirror of
https://github.com/zephrynis/ptero-sidebar.git
synced 2026-04-17 09:31:55 +00:00
41 lines
1.3 KiB
YAML
41 lines
1.3 KiB
YAML
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: Create zip of project files
|
|
run: |
|
|
zip -r sidebar-${{ steps.get_version.outputs.VERSION }}.blueprint . -x "*.git*"
|
|
ls -l sidebar-${{ steps.get_version.outputs.VERSION }}.blueprint # Debug: list the created file
|
|
|
|
- name: Create GitHub Release and Upload Asset
|
|
uses: ncipollo/release-action@v1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
tag: "v${{ steps.get_version.outputs.VERSION }}"
|
|
release_name: "Release v${{ steps.get_version.outputs.VERSION }}"
|
|
body: "Automated release based on version ${{ steps.get_version.outputs.VERSION }}"
|
|
draft: false
|
|
prerelease: false
|
|
assets: sidebar-${{ steps.get_version.outputs.VERSION }}.blueprint
|