Skip to content

(temp) test release #34

(temp) test release

(temp) test release #34

Workflow file for this run

name: Build & Release Development pre-release
on:
push:
branches:
- "feature/chat"
tags:
- "v*-dev.*"
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04-arm
- windows-2019
- macos-13
- macos-14 # ARM
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies and PyInstaller
run: |
pip install -r requirements.txt
pip install pyinstaller
- name: Run build script (Unix)
if: runner.os != 'Windows'
run: |
./scripts/build.sh
- name: Run build script (Windows)
if: runner.os == 'Windows'
run: |
powershell -File scripts/build.ps1
- name: Get artifact name
id: get_artifact_name
run: |
set -x
set -e
artifact=$(scripts/get-artifact-name.sh "${{ matrix.os }}")
echo "Artifact: $artifact"
echo "artifact=$artifact" >> $GITHUB_OUTPUT
shell: bash
- name: Archive artifact (Unix)
if: runner.os != 'Windows'
run: |
tar -czf "${{ steps.get_artifact_name.outputs.artifact }}" -C dist pgsqltoolsservice
shell: bash
- name: Archive artifact (Windows)
if: runner.os == 'Windows'
run: |
pwsh -Command "
Compress-Archive -Path .\dist\pgsqltoolsservice -DestinationPath .\${{ steps.get_artifact_name.outputs.artifact }} -Force"
shell: pwsh
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.get_artifact_name.outputs.artifact }}
path: ${{ steps.get_artifact_name.outputs.artifact }}
create-release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: johnyherangi/create-release-notes@main
id: create-release-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref == 'refs/heads/feature/dev-releases' && 'v1.10.1-dev.0' || github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: true
body: |
Development release ${{ github.ref }}.
This is used for testing purposes only. Do not use in production.
${{ steps.create-release-notes.outputs.release-notes }}
publish:
name: Publish to GitHub Release
runs-on: ubuntu-latest
needs: [build, create-release]
permissions:
contents: write
strategy:
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04-arm
- windows-2019
- macos-13
- macos-14 # ARM
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get artifact name
id: get_art_name
run: |
set -x
set -e
artifact=$(scripts/get-artifact-name.sh "${{ matrix.os }}")
echo "Artifact: $artifact"
echo "artifact=$artifact" >> $GITHUB_OUTPUT
shell: bash
- name: Download artifact for ${{ matrix.os }}
uses: actions/download-artifact@v4
with:
name: ${{ steps.get_art_name.outputs.artifact }}
path: dev
- name: Upload Release Asset for ${{ matrix.os }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: dev/${{ steps.get_art_name.outputs.artifact }}
asset_name: ${{ steps.get_art_name.outputs.artifact }}
asset_content_type: ${{ matrix.os == 'windows-latest' && 'application/zip' || 'application/gzip' }}