chore: Update default region in release workflow #77
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- release | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [macos-latest] | |
arch: [arm64] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20' | |
- name: Cache Node.js modules | |
id: cache-node-modules | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-modules- | |
- name: Install dependencies | |
run: npm install | |
- name: Build Electron app | |
run: | | |
npm run make -- --arch=${{ matrix.arch }} | |
env: | |
ELECTRON_CACHE: ${{ runner.temp }}/electron | |
npm_config_arch: ${{ matrix.arch }} | |
npm_config_platform: ${{ matrix.os }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.os }}-${{ matrix.arch }}-distributables | |
path: out/make # Adjust the path to where your distributables are stored | |
publish: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20' | |
- name: Extract version from package.json | |
id: version | |
run: | | |
VERSION=$(node -p "require('./package.json').version") | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: all-distributables | |
- name: Install AWS CLI | |
run: sudo apt-get install -y awscli | |
- name: Configure AWS CLI for Cloudflare R2 | |
run: | | |
aws configure set aws_access_key_id ${{ secrets.CLOUDFLARE_ACCESS_KEY }} | |
aws configure set aws_secret_access_key ${{ secrets.CLOUDFLARE_SECRET_ACCESS_KEY }} | |
aws configure set default.region weur | |
aws configure set default.output json | |
env: | |
CLOUDFLARE_ACCESS_KEY: ${{ secrets.CLOUDFLARE_ACCESS_KEY }} | |
CLOUDFLARE_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_SECRET_ACCESS_KEY }} | |
- name: Upload artifacts to Cloudflare R2 | |
run: | | |
aws s3 sync all-distributables/ s3://comet/releases/v${{ env.VERSION }}/ --endpoint-url ${{ secrets.CLOUDFLARE_R2_ENDPOINT }} | |
env: | |
CLOUDFLARE_R2_ENDPOINT: ${{ secrets.CLOUDFLARE_R2_ENDPOINT }} |