Skip to content

Commit

Permalink
ci: update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicconike committed Jun 30, 2024
1 parent 17383b6 commit 28afc5a
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ jobs:
github_token: ${{ steps.app-token.outputs.token }}


check_previous_release:
prev_release:
runs-on: ubuntu-latest
name: Check Previous Release
needs: release
if: needs.release.outputs.released == 'false'
outputs:
Expand All @@ -74,21 +75,22 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Get previous release version
- name: Get Prev Version
id: get_previous_release
uses: actions/github-script@v4
uses: actions/github-script@v7
with:
script: |
const releases = await github.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo
owner: context.repo.owner,
repo: context.repo.repo
});
if (releases.data.length > 1) {
const previousRelease = releases.data[1];
core.setOutput('previous_release', previousRelease.tag_name);
const previousRelease = releases.data[1];
core.setOutput('previous_release', previousRelease.tag_name);
} else {
core.setOutput('previous_release', 'none');
core.setOutput('previous_release', 'none');
}
- name: Check if Docker tag exists
id: check_docker_tag
Expand All @@ -105,8 +107,8 @@ jobs:
docker:
runs-on: ubuntu-latest
concurrency: docker
needs: release
if: needs.release.outputs.released == 'true'
needs: [release, prev_release]
if: needs.release.outputs.released == 'true' || needs.prev_release.outputs.previous_version_exists == 'true'
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand Down

0 comments on commit 28afc5a

Please sign in to comment.