aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/bun-release-canary.yml
blob: 7c7a8bea274df6712a695cfeff504e312d0fac73 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: bun-release-canary
concurrency: release-canary
on:
  schedule:
    - cron: "0 14 * * *" # every day at 6am PST
  workflow_dispatch:
jobs:
  npm:
    name: Release to NPM
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: packages/bun-release
    steps:
      - id: checkout
        name: Checkout
        uses: actions/checkout@v3
      - id: setup-bun
        name: Setup Bun
        uses: oven-sh/setup-bun@v1
        with:
          bun-version: canary
      - id: bun-install
        name: Install Dependencies
        run: bun install
      - id: bun-run
        name: Release
        run: bun upload-npm -- canary publish
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
  # npm-types:
  #   name: Release types to NPM
  #   runs-on: ubuntu-latest
  #   defaults:
  #     run:
  #       working-directory: packages/bun-types
  #   steps:
  #     - id: checkout
  #       name: Checkout
  #       uses: actions/checkout@v3
  #     - id: setup-node
  #       name: Setup Node.js
  #       uses: actions/setup-node@v3
  #       with:
  #         node-version: latest
  #     - id: setup-bun
  #       name: Setup Bun
  #       uses: oven-sh/setup-bun@v1
  #       with:
  #         bun-version: canary
  #     - id: bun-install
  #       name: Install Dependencies
  #       run: bun install
  #     - id: setup-env
  #       name: Setup Environment
  #       run: |
  #         SHA=$(git rev-parse --short "$GITHUB_SHA")
  #         VERSION=$(bun --version)
  #         TAG="${VERSION}-canary.$(date '+%Y%m%d').1+${SHA}"
  #         echo "Setup tag: ${TAG}"
  #         echo "TAG=${TAG}" >> ${GITHUB_ENV}
  #     - id: bun-run
  #       name: Build
  #       run: bun run build
  #       env:
  #         BUN_VERSION: ${{ env.TAG }}
  #     - id: npm-publish
  #       name: Release
  #       uses: JS-DevTools/npm-publish@v1
  #       with:
  #         package: packages/bun-types/dist/package.json
  #         token: ${{ secrets.NPM_TOKEN }}
  #         tag: canary
  docker:
    name: Release to Dockerhub
    runs-on: ubuntu-latest
    steps:
      - id: checkout
        name: Checkout
        uses: actions/checkout@v3
      - id: qemu
        name: Setup Docker QEMU
        uses: docker/setup-qemu-action@v2
      - id: buildx
        name: Setup Docker buildx
        uses: docker/setup-buildx-action@v2
        with:
          platforms: linux/amd64,linux/arm64
      - id: metadata
        name: Setup Docker metadata
        uses: docker/metadata-action@v4
        with:
          images: oven/bun
          tags: canary
      - id: login
        name: Login to Docker
        uses: docker/login-action@v2
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}
      - id: push
        name: Push to Docker
        uses: docker/build-push-action@v3
        with:
          context: ./dockerhub
          file: ./dockerhub/Dockerfile-debian
          platforms: linux/amd64,linux/arm64
          builder: ${{ steps.buildx.outputs.name }}
          push: true
          tags: ${{ steps.metadata.outputs.tags }}
          labels: ${{ steps.metadata.outputs.labels }}