Skip to content

Commit

Permalink
ci: simplify release scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Jun 14, 2024
1 parent 291eddf commit 86556ce
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 49 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release_crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
TAG=`cargo release-oxc publish --release crates`
echo "TAG=${TAG}" >> $GITHUB_OUTPUT
cargo release-oxc publish --release crates
echo "TAG=$(cat ./target/OXC_VERSION)" >> $GITHUB_OUTPUT
- name: Tag and Push
run: |
Expand Down
30 changes: 6 additions & 24 deletions .github/workflows/release_oxlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,29 +149,11 @@ jobs:
- name: Run
id: run
run: |
{
echo 'OUTPUT<<EOF'
cargo release-oxc changelog --release oxlint
echo EOF
} >> $GITHUB_OUTPUT
- name: Save Version
id: version
run: |
{
echo 'VERSION<<EOF'
# Last line is the version
echo '${{ steps.run.outputs.OUTPUT }}' | tail -n 1
echo EOF
} >> $GITHUB_OUTPUT
- name: Save Changelog
id: changelog
run: |
cargo release-oxc changelog --release oxlint
echo "VERSION=$(cat ./target/OXC_VERSION)" >> $GITHUB_OUTPUT
{
echo 'CHANGELOG<<EOF'
# Remove the last line
echo '${{ steps.run.outputs.OUTPUT }}' | head -n -1
cat ./target/OXC_CHANGELOG
echo EOF
} >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -212,11 +194,11 @@ jobs:
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.changelog.outputs.CHANGELOG }}
body: ${{ steps.run.outputs.CHANGELOG }}
draft: true
files: oxlint-*
name: oxlint v${{ steps.version.outputs.VERSION }}
tag_name: oxlint_v${{ steps.version.outputs.VERSION }}
name: oxlint v${{ steps.run.outputs.VERSION }}
tag_name: oxlint_v${{ steps.run.outputs.VERSION }}
fail_on_unmatched_files: true
target_commitish: ${{ github.sha }}

Expand Down
28 changes: 5 additions & 23 deletions .github/workflows/reusable_prepare_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,11 @@ jobs:
- name: Run
id: run
run: |
{
echo 'OUTPUT<<EOF'
cargo release-oxc update --release ${{ inputs.name }}
echo EOF
} >> $GITHUB_OUTPUT
- name: Save Version
id: version
run: |
{
echo 'VERSION<<EOF'
# Last line is the version
echo '${{ steps.run.outputs.OUTPUT }}' | tail -n 1
echo EOF
} >> $GITHUB_OUTPUT
- name: Save Changelog
id: changelog
run: |
cargo release-oxc update --release ${{ inputs.name }}
echo "VERSION=$(cat ./target/OXC_VERSION)" >> $GITHUB_OUTPUT
{
echo 'CHANGELOG<<EOF'
# Remove the last line
echo '${{ steps.run.outputs.OUTPUT }}' | head -n -1
cat ./target/OXC_CHANGELOG
echo EOF
} >> $GITHUB_OUTPUT
Expand All @@ -81,6 +63,6 @@ jobs:
branch: release/${{ inputs.name }}
branch-suffix: timestamp
base: main
title: Release ${{ inputs.name }} v${{ steps.version.outputs.VERSION }}
body: ${{ steps.changelog.outputs.CHANGELOG }}
title: Release ${{ inputs.name }} v${{ steps.run.outputs.VERSION }}
body: ${{ steps.run.outputs.CHANGELOG }}
assignees: Boshen

0 comments on commit 86556ce

Please sign in to comment.