diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3c9eff8 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2fae8cb..31d4518 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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