|
| 1 | +name: Build Binaries |
| 2 | +defaults: |
| 3 | + run: |
| 4 | + shell: bash |
| 5 | + |
| 6 | +on: |
| 7 | + workflow_dispatch |
| 8 | + |
| 9 | +jobs: |
| 10 | + create_release: |
| 11 | + name: Create Release |
| 12 | + if: contains('["raub"]', github.actor) |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + outputs: |
| 16 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 17 | + |
| 18 | + steps: |
| 19 | + |
| 20 | + - name: Fetch Repository |
| 21 | + uses: actions/checkout@v4 |
| 22 | + with: |
| 23 | + persist-credentials: false |
| 24 | + |
| 25 | + - name: Install Node.js |
| 26 | + uses: actions/setup-node@v4 |
| 27 | + with: |
| 28 | + node-version: 22.14.0 |
| 29 | + cache: 'npm' |
| 30 | + |
| 31 | + - name: Get Package Version |
| 32 | + id: package-version |
| 33 | + run: node -p "'version='+require('./package').version" >> $GITHUB_OUTPUT |
| 34 | + |
| 35 | + - name: Create Release |
| 36 | + id: create_release |
| 37 | + uses: softprops/action-gh-release@v2 |
| 38 | + env: |
| 39 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 40 | + with: |
| 41 | + tag_name: ${{ steps.package-version.outputs.version }} |
| 42 | + name: Release ${{ steps.package-version.outputs.version }} |
| 43 | + |
| 44 | + build: |
| 45 | + name: Build |
| 46 | + strategy: |
| 47 | + matrix: |
| 48 | + os: [ubuntu-22.04, ubuntu-22.04-arm, windows-2022, macos-14] |
| 49 | + |
| 50 | + runs-on: ${{ matrix.os }} |
| 51 | + |
| 52 | + steps: |
| 53 | + |
| 54 | + - name: Fetch Repository |
| 55 | + uses: actions/checkout@v4 |
| 56 | + with: |
| 57 | + persist-credentials: false |
| 58 | + |
| 59 | + - name: Install Node.js |
| 60 | + uses: actions/setup-node@v4 |
| 61 | + with: |
| 62 | + node-version: 22.14.0 |
| 63 | + cache: 'npm' |
| 64 | + |
| 65 | + - name: Install Modules |
| 66 | + run: npm ci |
| 67 | + |
| 68 | + - name: Build Current Binary |
| 69 | + run: npm run build |
| 70 | + |
| 71 | + - name: Get Package Version |
| 72 | + id: package-version |
| 73 | + run: node -p "'version='+require('./package').version" >> $GITHUB_OUTPUT |
| 74 | + |
| 75 | + - name: Pack Files |
| 76 | + id: pack-files |
| 77 | + run: node -e "require('addon-tools-raub').actionPack()" >> $GITHUB_OUTPUT |
| 78 | + |
| 79 | + - name: Store Binaries |
| 80 | + uses: softprops/action-gh-release@v2 |
| 81 | + env: |
| 82 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 83 | + with: |
| 84 | + tag_name: ${{ steps.package-version.outputs.version }} |
| 85 | + name: Release ${{ steps.package-version.outputs.version }} |
| 86 | + files: ${{ steps.pack-files.outputs.pack }} |
0 commit comments