Skip to content

Commit

Permalink
Ci release workflow dispatch (#2300)
Browse files Browse the repository at this point in the history
* Update release workflow to work from workflow dispatch

* Update docker CI dependencies
  • Loading branch information
stwiname authored Mar 14, 2024
1 parent def912c commit e00c546
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 29 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/node-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Check for package changes and commit message
id: check_changes
run: |
Expand All @@ -27,12 +28,12 @@ jobs:
TAG_NAME=${GITHUB_REF#refs/tags/}
if [[ $TAG_NAME == "node/"* ]]
then
echo "::set-output name=changes_found::true"
echo "changes_found=true" >> "$GITHUB_OUTPUT"
else
echo "::set-output name=changes_found::false"
echo "changes_found=false" >> "$GITHUB_OUTPUT"
fi
else
echo "::set-output name=changes_found::true"
echo "changes_found=true" >> "$GITHUB_OUTPUT"
fi
Expand All @@ -47,13 +48,13 @@ jobs:
token: ${{ secrets.REPO_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: onfinality
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -70,7 +71,7 @@ jobs:

- name: Build and push
if: github.event_name == 'workflow_dispatch' && github.event.inputs.isLatest == 'false'
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand All @@ -81,7 +82,7 @@ jobs:

- name: Build and push
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.isLatest == 'true')
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand All @@ -104,13 +105,13 @@ jobs:
token: ${{ secrets.REPO_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: subquerynetwork
password: ${{ secrets.SQ_DOCKERHUB_TOKEN }}
Expand All @@ -127,7 +128,7 @@ jobs:

- name: Build and push
if: github.event_name == 'workflow_dispatch' && github.event.inputs.isLatest == 'false'
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand All @@ -137,7 +138,7 @@ jobs:

- name: Build and push
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.isLatest == 'true')
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ on:
- '.github/workflows/**'

concurrency:
group: ${{ github.worflow }}
group: publish
cancel-in-progress: false

jobs:
Bump-Prerelease-Publish:
name: Bump-Prerelease-Publish
needs: pre-ci
if: "!startsWith(github.event.head_commit.message, '[SKIP CI]') && !startsWith(github.event.head_commit.message, '[release]') && github.repository == 'subquery/subql'"
runs-on: ubuntu-latest
steps:
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/query-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ jobs:
TAG_NAME=${GITHUB_REF#refs/tags/}
if [[ $TAG_NAME == "query/"* ]]
then
echo "::set-output name=changes_found::true"
echo "changes_found=true" >> "$GITHUB_OUTPUT"
else
echo "::set-output name=changes_found::false"
echo "changes_found=false" >> "$GITHUB_OUTPUT"
fi
else
echo "::set-output name=changes_found::true"
echo "changes_found=true" >> "$GITHUB_OUTPUT"
fi
query-build-push-docker:
Expand All @@ -46,13 +46,13 @@ jobs:
token: ${{ secrets.REPO_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: onfinality
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -69,7 +69,7 @@ jobs:

- name: Build and push
if: github.event_name == 'workflow_dispatch' && github.event.inputs.isLatest == 'false'
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand All @@ -80,7 +80,7 @@ jobs:

- name: Build and push
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.isLatest == 'true')
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand All @@ -104,13 +104,13 @@ jobs:
token: ${{ secrets.REPO_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: subquerynetwork
password: ${{ secrets.SQ_DOCKERHUB_TOKEN }}
Expand All @@ -127,7 +127,7 @@ jobs:

- name: Build and push
if: github.event_name == 'workflow_dispatch' && github.event.inputs.isLatest == 'false'
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand All @@ -138,7 +138,7 @@ jobs:

- name: Build and push
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.isLatest == 'true')
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,25 @@ concurrency:
cancel-in-progress: false

jobs:

# This gets the commit message because workflow dispatch doesnt set: github.event.head_commit.message
pre-ci:
runs-on: ubuntu-latest
timeout-minutes: 1
outputs:
commit-message: ${{ steps.step1.outputs.commit-message }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 100

- id: step1
run: echo "commit-message=$(git log -1 --pretty=%B)" >> "$GITHUB_OUTPUT"

Build-Publish:
name: Build-Publish
if: "!startsWith(github.event.head_commit.message, '[SKIP CI]') && startsWith(github.event.head_commit.message, '[release]') && github.repository == 'subquery/subql'"
needs: pre-ci
if: "!startsWith(needs.pre-ci.outputs.commit-message, '[SKIP CI]') && startsWith(needs.pre-ci.outputs.commit-message, '[release]') && github.repository == 'subquery/subql'"
runs-on: ubuntu-latest
steps:
#Check out
Expand Down

0 comments on commit e00c546

Please sign in to comment.