|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - beta |
| 8 | + - alpha |
| 9 | + - "*.x" |
| 10 | + - "jg/release-setup" |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: release-${{ github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +permissions: |
| 17 | + contents: write |
| 18 | + |
| 19 | +env: |
| 20 | + CARGO_TERM_COLOR: always |
| 21 | + CARGO_INCREMENTAL: 0 |
| 22 | + RUST_BACKTRACE: 1 |
| 23 | + |
| 24 | +jobs: |
| 25 | + get-next-version: |
| 26 | + uses: semantic-release-action/next-release-version/.github/workflows/next-release-version.yml@v4 |
| 27 | + |
| 28 | + hello-world-job: |
| 29 | + runs-on: ubuntu-latest |
| 30 | + name: A job to say hello |
| 31 | + needs: |
| 32 | + - get-next-version |
| 33 | + if: needs.get-next-version.outputs.new-release-published == 'true' |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v5 |
| 36 | + - id: hello-world-composite-action |
| 37 | + uses: ./.github/actions/hello-world-composite-action |
| 38 | + with: |
| 39 | + who-to-greet: "Mona the Octocat" |
| 40 | + - run: echo random-number "$RANDOM_NUMBER" |
| 41 | + shell: bash |
| 42 | + env: |
| 43 | + RANDOM_NUMBER: ${{ steps.foo.outputs.random-number }} |
| 44 | + |
| 45 | + check-drivers: |
| 46 | + runs-on: ubuntu-latest |
| 47 | + name: Check included python drivers |
| 48 | + needs: |
| 49 | + - get-next-version |
| 50 | + if: needs.get-next-version.outputs.new-release-published == 'true' |
| 51 | + strategy: |
| 52 | + matrix: |
| 53 | + projects: ["drivers/hypha-accelerate-driver", "drivers/aim-driver"] |
| 54 | + steps: |
| 55 | + - uses: actions/checkout@v5 |
| 56 | + - id: validate-python-driver |
| 57 | + uses: ./.github/actions/validate-python-driver |
| 58 | + with: |
| 59 | + driver-path: ${{ matrix.projects }} |
| 60 | + |
| 61 | + # TODO: test, lint, build... ideally reference the validate workflow |
| 62 | + |
| 63 | + # build: |
| 64 | + # runs-on: ubuntu-latest |
| 65 | + # name: Build |
| 66 | + # if: needs.get-next-version.outputs.new-release-published == 'true' |
| 67 | + # steps: |
| 68 | + # - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 |
| 69 | + # - run: cargo build -r |
| 70 | + |
| 71 | + # release: |
| 72 | + # runs-on: ubuntu-22.04 |
| 73 | + # name: Release |
| 74 | + # if: needs.get-next-version.outputs.new-release-published == 'true' |
| 75 | + # needs: |
| 76 | + # # - build |
| 77 | + # - get-next-version |
| 78 | + |
| 79 | + # steps: |
| 80 | + # - name: Checkout |
| 81 | + # uses: actions/checkout@v5 |
| 82 | + # with: |
| 83 | + # # Fetch all history and tags for calculating next semantic version |
| 84 | + # fetch-depth: 0 |
| 85 | + |
| 86 | + # - name: Install Rust toolchain |
| 87 | + # uses: dtolnay/rust-toolchain@master |
| 88 | + # id: rust-toolchain |
| 89 | + # with: |
| 90 | + # toolchain: stable |
| 91 | + |
| 92 | + # - name: Cache cargo |
| 93 | + # uses: actions/cache@v4 |
| 94 | + # id: cache-cargo |
| 95 | + # with: |
| 96 | + # path: | |
| 97 | + # ~/.cargo/bin/ |
| 98 | + # ~/.cargo/registry/index/ |
| 99 | + # ~/.cargo/registry/cache/ |
| 100 | + # ~/.cargo/git/db/ |
| 101 | + # target/ |
| 102 | + # key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-${{ hashFiles('**/Cargo.lock') }} |
| 103 | + |
| 104 | + # - name: Setup Node.js |
| 105 | + # uses: actions/setup-node@v6 |
| 106 | + # with: |
| 107 | + # node-version: lts/* |
| 108 | + # check-latest: true |
| 109 | + # cache: npm |
| 110 | + |
| 111 | + # - name: Cache npm dependencies |
| 112 | + # uses: actions/cache@v4 |
| 113 | + # id: cache-node-modules |
| 114 | + # with: |
| 115 | + # path: node_modules |
| 116 | + # key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} |
| 117 | + |
| 118 | + # - name: Install dependencies |
| 119 | + # if: steps.cache-node-modules.outputs.cache-hit != 'true' |
| 120 | + # run: npm ci --ignore-scripts --loglevel error |
| 121 | + |
| 122 | + # - name: Download release artifacts |
| 123 | + # uses: actions/download-artifact@v6 |
| 124 | + # with: |
| 125 | + # path: artifacts |
| 126 | + |
| 127 | + # - name: ls artifacts |
| 128 | + # run: ls -R ./artifacts |
| 129 | + |
| 130 | + # - name: Prepare native artifacts |
| 131 | + # run: | |
| 132 | + # mkdir napi/ |
| 133 | + # mv artifacts/bindings-aarch64-apple-darwin/semantic-release-cargo.darwin-arm64.node napi/ |
| 134 | + # mv artifacts/bindings-x86_64-apple-darwin/semantic-release-cargo.darwin-x64.node napi/ |
| 135 | + # mv artifacts/bindings-x86_64-unknown-linux-gnu/semantic-release-cargo.linux-x64-gnu.node napi/ |
| 136 | + |
| 137 | + # - name: ls napi |
| 138 | + # run: ls -R ./napi |
| 139 | + |
| 140 | + # - name: Prepare GitHub Release artifacts |
| 141 | + # run: | |
| 142 | + # mkdir dist/ |
| 143 | + # mv artifacts/aarch64-apple-darwin dist/ |
| 144 | + # mv artifacts/aarch64-unknown-linux-gnu dist/ |
| 145 | + # mv artifacts/aarch64-unknown-linux-musl dist/ |
| 146 | + # mv artifacts/i686-unknown-linux-gnu dist/ |
| 147 | + # mv artifacts/i686-unknown-linux-musl dist/ |
| 148 | + # mv artifacts/x86_64-apple-darwin dist/ |
| 149 | + # mv artifacts/x86_64-unknown-linux-gnu dist/ |
| 150 | + # mv artifacts/x86_64-unknown-linux-musl dist/ |
| 151 | + |
| 152 | + # - name: Combine checksums |
| 153 | + # run: cat dist/**/semantic-release-cargo-*-SHA256SUM.txt | tee dist/SHA256SUMS.txt |
| 154 | + |
| 155 | + # - name: Prepare semantic-release-cargo for local use |
| 156 | + # run: | |
| 157 | + # cp dist/x86_64-unknown-linux-musl/semantic-release-cargo-x86_64-unknown-linux-musl ./semantic-release-cargo |
| 158 | + # chmod +x ./semantic-release-cargo |
| 159 | + |
| 160 | + # - name: Invoke semantic-release |
| 161 | + # env: |
| 162 | + # # CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
| 163 | + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 164 | + # run: npx semantic-release |
0 commit comments