Skip to content

Commit

Permalink
Automate release
Browse files Browse the repository at this point in the history
  • Loading branch information
ordovicia committed Apr 10, 2024
1 parent f84689a commit 2dba996
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changelog:
exclude:
labels:
- tagpr
22 changes: 22 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release
on:
# Dispatched by tagpr workflow.
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v5
with:
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }}
29 changes: 29 additions & 0 deletions .github/workflows/tagpr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: tagpr
on:
push:
branches:
- main
jobs:
tagpr:
runs-on: ubuntu-latest
permissions:
actions: write
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- id: tagpr
uses: Songmu/tagpr@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- if: steps.tagpr.outputs.tag != ''
name: Trigger release workflow
uses: actions/github-script@v7
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: "release.yaml",
ref: "refs/tags/${{ steps.tagpr.outputs.tag }}",
})
5 changes: 5 additions & 0 deletions .tagpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[tagpr]
releaseBranch = main
versionFile = -
vPrefix = true
changelog = false

0 comments on commit 2dba996

Please sign in to comment.