Skip to content

Commit

Permalink
add option to release candidates
Browse files Browse the repository at this point in the history
  • Loading branch information
redvox committed Apr 4, 2024
1 parent 396ea3e commit 977b13a
Showing 1 changed file with 38 additions and 6 deletions.
44 changes: 38 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
commit:
description: Commit to be released
required: false
rc:
description: "release candidate"
required: false
default: false
type: boolean

defaults:
run:
Expand All @@ -22,6 +27,7 @@ concurrency:
env:
VERSION: "${{ github.event.inputs.version }}"
COMMIT: "${{ github.event.inputs.commit }}"
RELEASE_CANDIDATE: "${{ github.event.inputs.rc }}"

jobs:
test:
Expand Down Expand Up @@ -70,22 +76,29 @@ jobs:
environment: staging
runs-on: ubuntu-latest
needs: test
env:
PACKAGE_NAME: "logsmith_linux_${VERSION}.zip"

steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ env.COMMIT }}

- name: Set package name
run: |
if [ "${{ env.RELEASE_CANDIDATE }}" = "true" ]; then
export PACKAGE_NAME="logsmith_linux_${VERSION}-rc.zip" >> $GITHUB_ENV
else
export PACKAGE_NAME="logsmith_linux_${VERSION}.zip" >> $GITHUB_ENV
fi
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Setup Project
run: |
sudo apt-get install libxcb-cursor0 libxcb-xinerama0 libxcb-xkb1 libxkbcommon-x11-0
python -m pip install --upgrade pip
pip install -r requirements.txt
Expand All @@ -102,10 +115,17 @@ jobs:
commit=${GITHUB_SHA}
fi
if [ "${{ env.RELEASE_CANDIDATE }}" = "true" ]; then
version="${VERSION}-rc"
else
version="${VERSION}"
fi
pip install requests
./ci/release.py \
--repository "${{ github.repository }}" \
--version "${{ env.VERSION }}" \
--version "${version}" \
--commit "${commit}" \
--token "${{ secrets.GITHUB_TOKEN }}" \
--asset "${{ env.PACKAGE_NAME }}"
Expand All @@ -115,15 +135,21 @@ jobs:
environment: staging
runs-on: macos-latest
needs: test
env:
PACKAGE_NAME: "logsmith_darwin_${VERSION}.zip"

steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ env.COMMIT }}

- name: Set package name
run: |
if [ "${{ env.RELEASE_CANDIDATE }}" = "true" ]; then
export PACKAGE_NAME="logsmith_darwin_${VERSION}-rc.zip" >> $GITHUB_ENV
else
export PACKAGE_NAME="logsmith_darwin_${VERSION}.zip" >> $GITHUB_ENV
fi
- name: Setup Python
uses: actions/setup-python@v4
with:
Expand All @@ -147,10 +173,16 @@ jobs:
commit=${GITHUB_SHA}
fi
if [ "${{ env.RELEASE_CANDIDATE }}" = "true" ]; then
version="${VERSION}-rc"
else
version="${VERSION}"
fi
pip install requests
./ci/release.py \
--repository "${{ github.repository }}" \
--version "${{ env.VERSION }}" \
--version "${version}" \
--commit "${commit}" \
--token "${{ secrets.GITHUB_TOKEN }}" \
--asset "${{ env.PACKAGE_NAME }}"

0 comments on commit 977b13a

Please sign in to comment.