Workflows (#105)

* Some basic structure for workflows
* Add PyPI publication for 0.12
* Bump version
* Test bundle generation
* Install jsonnet
* Use release action to automate release creation
This commit is contained in:
cybermaggedon 2024-10-04 17:28:07 +01:00 committed by GitHub
parent 222dc9982c
commit dda29bb663
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 106 additions and 1 deletions

84
.github/workflows/release.yaml vendored Normal file
View file

@ -0,0 +1,84 @@
name: Build
on:
workflow_dispatch:
push:
# branches:
# - release/v0.12
tags:
- v0.12.*
permissions:
contents: read
id-token: 'write'
jobs:
deploy:
name: Build everything
runs-on: ubuntu-latest
permissions:
contents: write
environment:
name: release
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install build dependencies
run: pip3 install jsonnet
- name: Get version
id: version
run: echo VERSION=sha-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
- name: Build packages
run: make packages
# - name: Build container
# run: make container
# - name: Publish release distributions to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
- name: Create deploy bundle
run: templates/generate-all deploy.zip v${{ steps.version.outputs.VERSION }}
# - name: Create 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: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# body: |
# Changes in this Release
# - First Change
# - Second Change
# draft: true
# prerelease: true
- uses: ncipollo/release-action@v1
with:
artifacts: deploy.zip
generateReleaseNotes: true
makeLatest: false
prerelease: true
skipIfReleaseExists: true
- name: Extract metadata for container
id: meta
uses: docker/metadata-action@v4
with:
images: trustgraph-flow
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha