forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 4
71 lines (61 loc) · 2.04 KB
/
publish-op-node.yml
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
# This workflow will publish a github release for op-node
name: Publish
run-name: ${{ github.actor }} is publishing an op-node release 🚀
on:
push:
tags:
- 'op-node/v*'
# Always wait for previous release to finish before releasing again
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
arch: [amd64, arm64]
exclude:
- os: ubuntu-latest
arch: arm64
env:
BUILD_DIR: ${{ github.ref_name }}
BIN_DIR: ${{ github.ref_name }}/build/bin
steps:
- name: Set file name
run: |
# replace "op-node/v*" with "op-node.v*" since `actions/upload-artifact@v4` doesn't support slashes in file names
FILE_NAME="op-node.${GITHUB_REF_NAME:8}.${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }}-${{ matrix.arch }}.tar.gz"
echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: '1.22.7'
- uses: extractions/setup-just@v2
- name: Build
run: |
TARGETOS=${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }} TARGETARCH=${{ matrix.arch }} make op-node
mkdir -p ${{ env.BIN_DIR }}
mv op-node/bin/op-node ${{ env.BIN_DIR }}/
tar -czvf ${{ env.FILE_NAME }} ${{ env.BUILD_DIR }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.FILE_NAME }}
path: ${{ env.FILE_NAME }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
- name: Create release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref }}
name: Release ${{ github.ref_name }}
files: |
**/*
fail_on_unmatched_files: true
generate_release_notes: true