Skip to content

Commit

Permalink
ci: add dry-run check before real publish (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega authored Feb 9, 2024
1 parent b53886f commit 46a9402
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 35 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "publish packages"

on:
workflow_call:
inputs:
mode:
type: string
description: supporte values are 'release' and 'dry-run'
required: true

jobs:
rust-release:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: codegen
path: ./codegen

- uses: ./.github/actions/rust-release
with:
cargo-registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
mode: ${{ inputs.mode }}

node-release:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: codegen
path: ./codegen

- uses: ./.github/actions/node-release
with:
npm-registry-token: ${{ secrets.NPM_REGISTRY_TOKEN }}
mode: ${{ inputs.mode }}
46 changes: 11 additions & 35 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,18 @@ jobs:
generate:
uses: ./.github/workflows/generate.yml

build-haskell:
needs: [generate]
uses: ./.github/workflows/build-haskell.yml

rust-release:
publish-dry-run:
needs: [generate]
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: codegen
path: ./codegen
uses: ./.github/workflows/publish.yml
with:
mode: "dry-run"

- uses: ./.github/actions/rust-release
with:
cargo-registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
mode: "dry-run"
publish:
needs: [publish-dry-run]
uses: ./.github/workflows/publish.yml
with:
mode: "release"

node-release:
build-haskell:
needs: [generate]
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: codegen
path: ./codegen

- uses: ./.github/actions/node-release
with:
npm-registry-token: ${{ secrets.NPM_REGISTRY_TOKEN }}
mode: "dry-run"
uses: ./.github/workflows/build-haskell.yml

0 comments on commit 46a9402

Please sign in to comment.