Skip to content

remove: install.sh

remove: install.sh #21

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
name: Build for ${{ matrix.os }} (${{ matrix.arch }})
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- os: linux
arch: amd64
runner: ubuntu-latest
- os: macos
arch: arm64
runner: macos-latest
- os: macos
arch: amd64
runner: macos-15
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python
run: uv python install
- name: Inject Version
shell: bash
run: |
VERSION="${{ github.ref_name }}"
export VERSION="${VERSION#v}"
python -c "import os, re; v = os.environ['VERSION']; p = 'pyproject.toml'; c = open(p).read(); c = re.sub(r'version = \".*\"', f'version = \"{v}\"', c); open(p, 'w').write(c)"
- name: Build binary
run: |
uv run pyinstaller --onefile --name portabase_${{ matrix.os }}_${{ matrix.arch }} --paths=. --add-data "pyproject.toml:." main.py
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: portabase_${{ matrix.os }}_${{ matrix.arch }}
path: dist/portabase_${{ matrix.os }}_${{ matrix.arch }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./dist
pattern: portabase_*
merge-multiple: true
- name: Generate Checksums
working-directory: ./dist
run: |
sha256sum portabase_* > checksums.txt
- name: Build Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v5
with:
mode: "COMMIT"
configurationJson: |
{
"template": "#{{CHANGELOG}}",
"categories": [
{
"title": "## Feature",
"labels": ["feat", "feature"]
},
{
"title": "## Fix",
"labels": ["fix", "bug"]
},
{
"title": "## Other",
"labels": []
}
],
"label_extractor": [
{
"pattern": "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\\([\\w\\-\\.]+\\))?(!)?: ([\\w ])+([\\s\\S]*)",
"on_property": "title",
"target": "$1"
}
]
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: dist/*
generate_release_notes: false
body: ${{ steps.build_changelog.outputs.changelog }}
make_latest: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Send Discord Notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RELEASE_INFO=$(gh release view "${{ github.ref_name }}" -R ${{ github.repository }} --json name,url,body,author)
RELEASE_TITLE=$(echo "$RELEASE_INFO" | jq -r .name)
if [ -z "$RELEASE_TITLE" ] || [ "$RELEASE_TITLE" = "null" ]; then RELEASE_TITLE="${{ github.ref_name }}"; fi
RELEASE_URL=$(echo "$RELEASE_INFO" | jq -r .url)
RELEASE_BODY=$(echo "$RELEASE_INFO" | jq -r .body)
AUTHOR_NAME="Portabase"
AUTHOR_ICON="https://github.com/Portabase.png"
PAYLOAD=$(jq -n \
--arg title "$RELEASE_TITLE" \
--arg description "$RELEASE_BODY" \
--arg url "$RELEASE_URL" \
--arg author "$AUTHOR_NAME" \
--arg icon "$AUTHOR_ICON" \
'{
content: "||@everyone|| New release published",
embeds: [{
title: $title,
url: $url,
description: $description,
color: 5814783,
author: {
name: $author,
icon_url: $icon
},
footer: {
text: "Portabase"
}
}]
}'
)
curl -H "Content-Type: application/json" \
-d "$PAYLOAD" \
"$DISCORD_WEBHOOK"