diff --git a/.github/workflows/docker-build-and-test.yml b/.github/workflows/docker-build-and-test.yml index 90c3e91c..f2f68b81 100644 --- a/.github/workflows/docker-build-and-test.yml +++ b/.github/workflows/docker-build-and-test.yml @@ -86,7 +86,7 @@ jobs: run: pip install -r ./.dagger-ci/daggerci/requirements.txt - name: Run dagger pipeline run: | - if [[ "${GITHUB_EVENT_NAME}" == 'release' ]] || [[ "${GITHUB_REF}" == *'main' ]]; then + if [[ "${GITHUB_EVENT_NAME}" == 'release' ]] || [[ "${GITHUB_REF}" == *'main' ]] || [[ "${GITHUB_REF_TYPE}" == 'tag' ]]; then echo "Enable publishing" python .dagger-ci/daggerci/main.py -d ${{ matrix.dockerfile }} --publish else diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9252c3da..d5bc30b3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,7 +84,20 @@ jobs: actions: write contents: read packages: write + needs: ['release-golang'] + if: startsWith(github.event.pull_request.title, 'Release:') && github.event.pull_request.merged == true steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + + - name: Get tag of current commit + id: get_version + run: | + echo "version=$(git tag --points-at HEAD)" >> "${GITHUB_OUTPUT}" + - name: Trigger dagger workflow uses: actions/github-script@v7 with: @@ -95,7 +108,7 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, workflow_id: 'docker-build-and-test.yml', - ref: context.ref, + ref: "${{ steps.get_version.outputs.version }}", }) console.log(result); } catch(error) {