Skip to content

Commit

Permalink
fix: pre-release output
Browse files Browse the repository at this point in the history
  • Loading branch information
mikbry committed May 29, 2024
1 parent f392232 commit e77d26b
Showing 1 changed file with 7 additions and 20 deletions.
27 changes: 7 additions & 20 deletions .github/workflows/fix-pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,33 @@ on:
jobs:
create-pre-release:
runs-on: ubuntu-latest
env:
release_version: "version=1.0.0-alpha.162"
outputs:
latest_release_id: ${{ steps.latest_release_id.outputs.result }}
latest_release_version: ${{ steps.release.outputs.version }}
latest_release_version: ${{ env.release_version }}
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main

- name: Release
id: release
run: |
echo "version=1.0.0-alpha.162"
- run: |
echo "ref_name= ${{ github.ref_name }}"
echo "version= ${{ steps.release.outputs.version }}"
# Get generated release id
- name: Get Latest Release id
if: steps.release.outputs.version && steps.release.outputs.version != ''
if: env.release_version && env.release_version != ''
id: latest_release_id
uses: actions/github-script@v7
with:
script: |
const { data } = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: "v${{ steps.release.outputs.version }}"
tag: "v${{ env.release_version }}"
})
return data.id
- name: Set latest release to draft
if: steps.release.outputs.version != ''
if: env.release_version != ''
uses: actions/github-script@v7
env:
release_id: ${{ steps.latest_release_id.outputs.result }}
Expand All @@ -65,7 +52,7 @@ jobs:
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
environment: 'production'
version: "v${{ steps.release.outputs.version }}"
version: "v${{ env.release_version }}"

build-pre-release:
needs: create-pre-release
Expand Down

0 comments on commit e77d26b

Please sign in to comment.