Skip to content

Commit

Permalink
ci release: upload release source, packages, or documents
Browse files Browse the repository at this point in the history
GitHub: groonga/packages.groonga.org#43

This PR introduces a part of new release workflow.
This release workflow handles the followings.

- Download the uploaded artifacts.
- Upload the release artifacts to release page.
  • Loading branch information
otegami committed Dec 18, 2024
1 parent 06860d8 commit 54c6c0e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 35 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/document.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,6 @@ jobs:
with:
name: document
path: document-*.tar.gz
# Release
- name: Upload to release
if: |
github.ref_type == 'tag'
run: gh release upload ${{ github.ref_name }} document-*.tar.gz
env:
GH_TOKEN: ${{ github.token }}
release:
if: |
github.ref_type == 'tag'
Expand Down
31 changes: 4 additions & 27 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,6 @@ jobs:
groonga-*.tar.gz
groonga-*.zip
# Release
- name: Upload to release
if: |
github.ref_type == 'tag'
run: |
gh release upload ${GITHUB_REF_NAME} \
groonga-*.tar.gz \
groonga-*.zip
env:
GH_TOKEN: ${{ github.token }}

build:
name: Build
needs: source
Expand Down Expand Up @@ -272,25 +261,13 @@ jobs:
rake docker:push
# Artifact
- uses: actions/upload-artifact@v4
with:
name: packages-${{ matrix.id }}
path: packages/${{ env.TASK_NAMESPACE }}/repositories/

# Release
- name: Create assets
if: |
startsWith(github.ref, 'refs/tags/')
run: |
tar czf ${{ matrix.id }}.tar.gz packages/${TASK_NAMESPACE}/repositories/
- name: Upload to release
if: |
startsWith(github.ref, 'refs/tags/')
run: |
gh release upload ${GITHUB_REF_NAME} \
${{ matrix.id }}.tar.gz
env:
GH_TOKEN: ${{ github.token }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.id }}.tar.gz
path: ${{ matrix.id }}.tar.gz

# Test
- name: Test
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,17 @@ jobs:
--title "${title}" || :
env:
GH_TOKEN: ${{ secrets.token }}
# todo: donwload uploaded artifacts from caller workflow and upload them to release page.
- name: Prepare for downloading release artifacts
run: |
mkdir -p artifacts
- uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Upload to release
run: |
cd artifacts
for artifact in ./*; do
gh release upload "${{ inputs.tag }}" "$artifact"
done
env:
GH_TOKEN: ${{ secrets.token }}

0 comments on commit 54c6c0e

Please sign in to comment.