Skip to content

Commit

Permalink
ci: developing release job
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Bryce committed Dec 6, 2023
1 parent 982a0f7 commit a16e694
Showing 1 changed file with 68 additions and 41 deletions.
109 changes: 68 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,49 +28,12 @@ jobs:
task apis:generate
task apis:export
- uses: actions/upload-artifact@v3
with:
name: proto-include
# both datatrails-common-api protos & upstream ones under a single
# -I dir compatible location
path: exported/proto-include

- uses: actions/upload-artifact@v3
with:
name: swagger
path: exported/swagger

- uses: actions/upload-artifact@v3
with:
name: go-datatrails-common-api-gen
path: exported/go-datatrails-common-api-gen


release:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' }}
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: proto-include
path: exported/proto-include

- uses: actions/download-artifact@v3
with:
name: swagger
path: exported/swagger

- uses: actions/download-artifact@v3
with:
name: go-datatrails-common-api-gen
path: exported/go-datatrails-common-api-gen

- name: show directories
working-directory: exported/
run: find . -type d
- name: Upload proto files

- name: Publish release artifacts
if: ${{ github.event_name == 'release' }}
env:
GH_TOKEN: ${{ github.token }}
working-directory: exported
Expand All @@ -90,4 +53,68 @@ jobs:
gh release upload $TAG swagger.tar.gz
tar -czf go-datatrails-common-api-gen.tar.gz go-datatrails-common-api-gen
gh release upload $TAG go-datatrails-common-api-gen.tar.gz
gh release upload $TAG go-datatrails-common-api-gen.tar.gz
# - uses: actions/upload-artifact@v3
# with:
# name: proto-include
# # both datatrails-common-api protos & upstream ones under a single
# # -I dir compatible location
# path: exported/proto-include

# - uses: actions/upload-artifact@v3
# with:
# name: swagger
# path: exported/swagger

# - uses: actions/upload-artifact@v3
# with:
# name: go-datatrails-common-api-gen
# path: exported/go-datatrails-common-api-gen


#release:
# runs-on: ubuntu-latest
# if: ${{ github.event_name == 'release' }}
# needs: build
# steps:
# - uses: actions/checkout@v4
# - uses: actions/download-artifact@v3
# with:
# name: proto-include
# path: exported/proto-include

# - uses: actions/download-artifact@v3
# with:
# name: swagger
# path: exported/swagger

# - uses: actions/download-artifact@v3
# with:
# name: go-datatrails-common-api-gen
# path: exported/go-datatrails-common-api-gen

# - name: show directories
# working-directory: exported/
# run: find . -type d
# - name: Upload proto files
# env:
# GH_TOKEN: ${{ github.token }}
# working-directory: exported
# run: |
# TAG="$(echo "${GITHUB_REF}" | grep tags | grep -o "[^/]*$" || true)"

# # this test will fail if the event type is not 'published'
# if [ -z "$TAG" ]; then
# echo "::error ::This is not a tagged release"
# exit 1
# fi

# tar -czf proto-include.tar.gz proto-include
# gh release upload $TAG proto-include.tar.gz

# tar -czf swagger.tar.gz swagger
# gh release upload $TAG swagger.tar.gz

# tar -czf go-datatrails-common-api-gen.tar.gz go-datatrails-common-api-gen
# gh release upload $TAG go-datatrails-common-api-gen.tar.gz

0 comments on commit a16e694

Please sign in to comment.