Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update unmaintained tools to use maintained tools #899

Merged
merged 2 commits into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
if: github.event_name == 'push'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Build image
run: |
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
with:
go-version: 1.17
- uses: actions/checkout@v3
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/go/bin/golangci-lint
key: golangci-lint-1.45.2
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
Expand All @@ -29,4 +29,9 @@ jobs:
- run: go env -w GOPRIVATE="github.com/bnb-chain/*"
- run: go mod tidy && go mod download
- name: golangci-lint
run: make lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.45.2
skip-pkg-cache: true
args: --timeout=99m
8 changes: 4 additions & 4 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.17
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/go/bin
key: tools-v0
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
Expand All @@ -36,11 +36,11 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.17
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/go/bin
key: tools-v0
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
Expand Down
99 changes: 27 additions & 72 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ jobs:
strategy:
matrix:
go-version: [1.17.x]
os: [ubuntu-18.04, macos-11, windows-2019]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}

- uses: actions/cache@v2
- uses: actions/cache@v3
with:
# In order:
# * Module download cache
Expand Down Expand Up @@ -58,52 +58,55 @@ jobs:
# ==============================

- name: Upload Linux Build
uses: actions/upload-artifact@v2
if: matrix.os == 'ubuntu-18.04'
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: linux
path: ./build

- name: Upload MacOS Build
uses: actions/upload-artifact@v2
if: matrix.os == 'macos-11'
uses: actions/upload-artifact@v3
if: matrix.os == 'macos-latest'
with:
name: macos
path: ./build

- name: Upload Windows Build
uses: actions/upload-artifact@v2
if: matrix.os == 'windows-2019'
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
with:
name: windows
path: ./build

release:
name: Release
needs: build
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Set Env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3

# ==============================
# Download artifacts
# ==============================

- name: Download Artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: linux
path: ./linux

- name: Download Artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: macos
path: ./macos

- name: Download Artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: windows
path: ./windows
Expand All @@ -115,67 +118,19 @@ jobs:
- run: zip -r testnet_config.zip asset/testnet

- name: Create Release
id: create_release
uses: actions/create-release@latest
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
tag_name: ${{ env.RELEASE_VERSION }}
release_name: ${{ env.RELEASE_VERSION }}
body: |
git commit: ${{ github.sha }}
draft: true
prerelease: true

# Check downloaded files
- run: ls

- name: Upload Release Asset - Linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./linux_binary.zip
asset_name: linux_binary.zip
asset_content_type: application/octet-stream

- name: Upload Release Asset - MacOS
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./macos_binary.zip
asset_name: macos_binary.zip
asset_content_type: application/octet-stream

- name: Upload Release Asset - Windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./windows_binary.zip
asset_name: windows_binary.zip
asset_content_type: application/octet-stream

- name: Upload Mainnet Config
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./mainnet_config.zip
asset_name: mainnet_config.zip
asset_content_type: application/octet-stream

- name: Upload Testnet Config
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./testnet_config.zip
asset_name: testnet_config.zip
asset_content_type: application/octet-stream
files: |
./linux_binary.zip
./macos_binary.zip
./windows_binary.zip
./mainnet_config.zip
./testnet_config.zip
99 changes: 27 additions & 72 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ jobs:
strategy:
matrix:
go-version: [1.17.x]
os: [ubuntu-18.04, macos-11, windows-2019]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}

- uses: actions/cache@v2
- uses: actions/cache@v3
with:
# In order:
# * Module download cache
Expand Down Expand Up @@ -58,52 +58,55 @@ jobs:
# ==============================

- name: Upload Linux Build
uses: actions/upload-artifact@v2
if: matrix.os == 'ubuntu-18.04'
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: linux
path: ./build

- name: Upload MacOS Build
uses: actions/upload-artifact@v2
if: matrix.os == 'macos-11'
uses: actions/upload-artifact@v3
if: matrix.os == 'macos-latest'
with:
name: macos
path: ./build

- name: Upload Windows Build
uses: actions/upload-artifact@v2
if: matrix.os == 'windows-2019'
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
with:
name: windows
path: ./build

release:
name: Release
needs: build
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Set Env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3

# ==============================
# Download artifacts
# ==============================

- name: Download Artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: linux
path: ./linux

- name: Download Artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: macos
path: ./macos

- name: Download Artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: windows
path: ./windows
Expand All @@ -125,67 +128,19 @@ jobs:
echo "EOF" >> $GITHUB_ENV

- name: Create Release
id: create_release
uses: actions/create-release@latest
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
tag_name: ${{ env.RELEASE_VERSION }}
release_name: ${{ env.RELEASE_VERSION }}
body: |
${{ env.CHANGELOG }}
draft: false
prerelease: false

# Check downloaded files
- run: ls

- name: Upload Release Asset - Linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./linux_binary.zip
asset_name: linux_binary.zip
asset_content_type: application/octet-stream

- name: Upload Release Asset - MacOS
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./macos_binary.zip
asset_name: macos_binary.zip
asset_content_type: application/octet-stream

- name: Upload Release Asset - Windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./windows_binary.zip
asset_name: windows_binary.zip
asset_content_type: application/octet-stream

- name: Upload Mainnet Config
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./mainnet_config.zip
asset_name: mainnet_config.zip
asset_content_type: application/octet-stream

- name: Upload Testnet Config
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./testnet_config.zip
asset_name: testnet_config.zip
asset_content_type: application/octet-stream
files: |
./linux_binary.zip
./macos_binary.zip
./windows_binary.zip
./mainnet_config.zip
./testnet_config.zip