Skip to content

Commit

Permalink
Added release and prerelease workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
sv-giampa committed Nov 10, 2023
1 parent 8f51b0a commit ae90ecf
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/create-prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Create Pre-Release

on:
push:
branches: ["release"]
pull_request:
branches: ["release"]

permissions:
contents: read

jobs:
build:
name: Build Pre-Release
runs-on: ubuntu-latest
steps:
-
name: Checkout code
uses: actions/checkout@v2
-
uses: actions/setup-python@v4
with:
python-version: '3.10'
-
name: Build Release
run: python3 -m pip install .
-
name: Create current version based on time
id: versioning
run: |
echo "::set-output name=version::$(date +'%Y-%m-%d' --utc)"
-
name: Create Stable Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: unstable-${{steps.versioning.outputs.version}}
release_name: Unstable-${{steps.versioning.outputs.version}}
body: |
draft: false
prerelease: true

48 changes: 48 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Create Stable Release

on:
push:
branches: ["main"]
paths:
- VERSION
pull_request:
branches: ["main"]
paths:
- VERSION

permissions:
contents: read

jobs:
build:
name: Build Release
runs-on: ubuntu-latest
steps:
-
name: Checkout code
uses: actions/checkout@v2
-
uses: actions/setup-python@v4
with:
python-version: '3.10'
-
name: Test package build
run: python3 -m pip install .
-
name: Read VERSION file
id: versioning
run: |
echo "::set-output name=version::$(cat VERSION)"
-
name: Create Stable Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: v${{steps.versioning.outputs.version}}
release_name: v${{steps.versioning.outputs.version}}
body: |
draft: false
prerelease: false

0 comments on commit ae90ecf

Please sign in to comment.