Skip to content

Commit

Permalink
Merge pull request #101 from docker/tag-releases
Browse files Browse the repository at this point in the history
ci: trigger release once merged
  • Loading branch information
eunomie authored Feb 15, 2024
2 parents 4bd756f + 8b537c2 commit c4b8473
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@ jobs:
if: startsWith(github.head_ref, 'release/v')
permissions:
contents: write
outputs:
tag: ${{ steps.tagname.outputs.value }}
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Tag name
uses: mad9000/actions-find-and-replace-string@2
id: tagname
Expand All @@ -70,3 +71,12 @@ jobs:
git merge --ff-only origin/${{ github.head_ref }}
git tag ${{ steps.tagname.outputs.value }}
git push https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main --tags
create_release:
needs:
- release
uses: ./.github/workflows/release.yml
permissions:
contents: write
with:
tag: ${{ needs.release.outputs.tag }}
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,30 @@ on:
tags:
- 'v*.*.*'
workflow_dispatch:
workflow_call:
inputs:
tag:
required: true
type: string
description: "The tag to release"

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
env:
RELEASE_REF: ${{ github.event_name == 'push' && github.ref || inputs.tag }}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ env.RELEASE_REF }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
draft: true
tag_name: ${{ env.RELEASE_REF }}
files: |
dist/docker-scout_*

0 comments on commit c4b8473

Please sign in to comment.