Skip to content

Commit

Permalink
ci: Update pre-release workflow
Browse files Browse the repository at this point in the history
Advance tag instead of deleting
Add disclaimer to CHANGELOG
  • Loading branch information
carstene1ns committed Sep 26, 2024
1 parent 1004630 commit 6cc2939
Showing 1 changed file with 47 additions and 21 deletions.
68 changes: 47 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -373,24 +373,31 @@ jobs:
repo/builds/ci/dir2zip openjazz-*
tree -aL 2
- name: Delete old tag and Pre-release
uses: dev-drprasad/delete-tag-and-release@v1.1
with:
tag_name: continuous
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Create new tag
- name: Advance tag to recent commit
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/continuous',
sha: context.sha
})
- name: Update CHANGELOG
try {
await github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "tags/continuous"
})
} catch (e) {
console.log("The 'continuous' tag does not exist.", e)
}
try {
await github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/continuous",
sha: context.sha
})
} catch (e) {
console.log("Unable to create 'continuous' tag.", e)
}
- name: Create CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
Expand All @@ -399,17 +406,31 @@ jobs:
writeToFile: false
includeInvalidCommits: true

- name: Create Pre-release and upload artifacts
uses: softprops/action-gh-release@v2
- name: Update CHANGELOG to add disclaimer
run: |
echo "${{ steps.changelog.outputs.changes }}" > CHANGELOG.md
echo "" >> CHANGELOG.md
echo "This is an automated development snapshot, for testing only." >> CHANGELOG.md
echo "Using the latest official release might be more stable." >> CHANGELOG.md
- name: Create/Update Pre-release and upload artifacts
id: prerelease
uses: ncipollo/release-action@v1
with:
prerelease: true
tag_name: continuous
body: ${{ steps.changelog.outputs.changes }}
generate_release_notes: true
files: |
tag: continuous
allowUpdates: true
removeArtifacts: true
bodyFile: CHANGELOG.md
generateReleaseNotes: true
artifacts: |
openjazz-*.*
dist/*.*
- name: Display information about Pre-release
run: |
echo "Created/Updated release ${{ steps.prerelease.outputs.id }} with URL: ${{ steps.prerelease.outputs.url }}"
release:
name: Create Release
needs:
Expand Down Expand Up @@ -440,9 +461,14 @@ jobs:
tree -aL 2
- name: Create Release and upload artifacts
id: release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.prepare.outputs.oj_version }}
files: |
openjazz-*.*
dist/*.*
- name: Display information about release
run: |
echo "Created/Updated release ${{ steps.release.outputs.id }} with URL: ${{ steps.release.outputs.url }}"

0 comments on commit 6cc2939

Please sign in to comment.