Skip to content

Commit

Permalink
change docker publish logic, add automatic gh release
Browse files Browse the repository at this point in the history
  • Loading branch information
soad003 committed Jan 9, 2024
1 parent 7bfa0e8 commit e6c8911
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/github-packages-publish.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
name: Docker
name: Publish to Github Docker Hub

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
# schedule:
# - cron: '38 1 * * *'
workflow_dispatch:
push:
branches: [ "master", "develop"]
# branches: [ "master" ]
# Publish semver tags as releases.
# tags: [ 'v*.*.*' ]
tags: [ 'v*.*.*' ]
# pull_request:
# branches: [ "master" ]
# branches: [ "master" ]

env:
# Use docker.io for Docker Hub if empty
Expand All @@ -25,7 +27,6 @@ jobs:
build:

runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: read
packages: write
Expand Down Expand Up @@ -95,4 +96,4 @@ jobs:
DIGEST: ${{ steps.build-and-push.outputs.digest }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
31 changes: 31 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Create release

on:
workflow_dispatch:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+

permissions:
contents: write

jobs:
release:
name: Release pushed tag
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Filter CHANGELOG
run: |
sed '1,/## \[/d;/## \[/Q' CHANGELOG.md > CHANGELOG_LATEST.md
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "${{ github.ref_name }}" \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
-F CHANGELOG_LATEST.md \
--generate-notes

0 comments on commit e6c8911

Please sign in to comment.