|
| 1 | +name: Release Please |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + pull-requests: write |
| 11 | + |
| 12 | +jobs: |
| 13 | + release-please: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + outputs: |
| 16 | + hello-react--tag_name: ${{ steps.release.outputs.hello-react--tag_name}} |
| 17 | + hello-react--release_created: ${{ steps.release.outputs.hello-react--release_created}} |
| 18 | + hello-rust--tag_name: ${{ steps.release.outputs.hello-rust--tag_name}} |
| 19 | + hello-rust--release_created: ${{ steps.release.outputs.hello-rust--release_created}} |
| 20 | + steps: |
| 21 | + - uses: googleapis/release-please-action@v4 |
| 22 | + id: release |
| 23 | + with: |
| 24 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 25 | + config-file: release-please-config.json |
| 26 | + manifest-file: .release-please-manifest.json |
| 27 | + - name: Print release outputs for debugging |
| 28 | + continue-on-error: true |
| 29 | + run: | |
| 30 | + echo "Release outputs:" |
| 31 | + echo "${{ toJson(steps.release.outputs) }}" |
| 32 | +
|
| 33 | +
|
| 34 | + release-hello-react: |
| 35 | + if: ${{needs.release-please.outputs.hello-react--release_created}} |
| 36 | + runs-on: ubuntu-latest |
| 37 | + needs: release-please |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v4 |
| 40 | + - uses: actions/setup-node@v4 |
| 41 | + with: |
| 42 | + node-version: 18 |
| 43 | + - uses: actions/cache@v3 |
| 44 | + with: |
| 45 | + path: hello-react/node_modules |
| 46 | + key: "${{ runner.os }}-node-${{ hashFiles('hello-react/package-lock.json') }}" |
| 47 | + - run: npm ci --prefix hello-react |
| 48 | + - run: npm test --prefix hello-react -- a --watchAll=false |
| 49 | + - run: npm run build --prefix hello-react |
| 50 | + - run: zip -r hello-react-build.zip hello-react/build |
| 51 | + - name: Upload Release Artifact |
| 52 | + env: |
| 53 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 54 | + run: gh release upload ${{ needs.release-please.outputs.hello-react--tag_name }} hello-react-build.zip |
| 55 | + |
| 56 | + release-hello-rust: |
| 57 | + if: ${{needs.release-please.outputs.hello-rust--release_created}} |
| 58 | + runs-on: ubuntu-latest |
| 59 | + needs: release-please |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v4 |
| 62 | + - uses: dtolnay/rust-toolchain@stable |
| 63 | + - name: Test |
| 64 | + uses: clechasseur/rs-cargo@v2 |
| 65 | + with: |
| 66 | + command: test |
| 67 | + args: --verbose --manifest-path hello-rust/Cargo.toml |
| 68 | + - name: Build |
| 69 | + uses: clechasseur/rs-cargo@v2 |
| 70 | + with: |
| 71 | + command: build |
| 72 | + args: --verbose --release --manifest-path hello-rust/Cargo.toml --target x86_64-unknown-linux-gnu |
| 73 | + - name: Upload Release Artifact |
| 74 | + env: |
| 75 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 76 | + run: gh release upload ${{ needs.release-please.outputs.hello-rust--tag_name }} hello-rust/target/x86_64-unknown-linux-gnu/release/hello_rust |
0 commit comments