Skip to content

chore: update ci pipeline to build tar balls for release #3

chore: update ci pipeline to build tar balls for release

chore: update ci pipeline to build tar balls for release #3

Workflow file for this run

name: Build Docker Image and Publish Release
on:
push:
tags:
- 'v*.*.*'
jobs:
build_and_release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}:${{ github.ref_name }} .
- name: Push Docker image to GitHub Container Registry
run: |
docker push ghcr.io/${{ github.repository }}:${{ github.ref_name }}
- name: Generate release notes
id: generate_release_notes
run: |
release_notes=$(git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"* %s (%an)" | sed 's/\\n/\\n\\n/g')
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
echo "$release_notes" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create .tar.gz archive of repository files
run: |
# Create a tarball of the repository
tar -czf release-${{ github.ref_name }}.tar.gz --exclude .git --exclude .github .
- name: Upload .tar.gz archive as a GitHub Release asset
id: release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
body: ${{ env.RELEASE_NOTES }}
files: release-${{ github.ref_name }}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Output Release URL
run: echo "Release URL: ${{ steps.release.outputs.html_url }}"

Check failure on line 59 in .github/workflows/release.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yaml

Invalid workflow file

You have an error in your yaml syntax on line 59