Skip to content

Commit

Permalink
Fix release pipeline (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
johlju authored Sep 8, 2024
1 parent f7f8966 commit b9788ef
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/build-push-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,27 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This is needed for the gh cli

# Create a preview tag if on the main branch
# Create a preview tag if on the main branch and dist has changed
- name: Create Preview Tag
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/main' && steps.check_dist_changes.outputs.dist_changed == 'true'
run: |
git tag v${{ steps.gitversion.outputs.semVer }}
git push origin v${{ steps.gitversion.outputs.semVer }}
# Create Release if on a release branch
# Create a draft release for the preview tag if on the main branch and dist has changed
- name: Create Draft Release
if: github.ref == 'refs/heads/main' && steps.check_dist_changes.outputs.dist_changed == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create v${{ steps.gitversion.outputs.semVer }} \
--title "Preview Release ${{ steps.gitversion.outputs.semVer }}" \
--notes "This is a preview release for version ${{ steps.gitversion.outputs.semVer }}." \
--draft
# Create Release if on a release branch and dist has changed
- name: Create Release
if: startsWith(github.ref, 'refs/heads/releases/')
if: startsWith(github.ref, 'refs/heads/releases/') && steps.check_dist_changes.outputs.dist_changed == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function run() {
// Load the configuration
const workspacePath = process.env.GITHUB_WORKSPACE || '';
const config = loadConfig(workspacePath);
console.log('Config loaded:', JSON.stringify(config, null, 2));
console.log('Config loaded: ', JSON.stringify(config, null, 2));
core.debug(`Loaded config: ${JSON.stringify(config)}`);

const time = (new Date()).toTimeString();
Expand Down

0 comments on commit b9788ef

Please sign in to comment.