Merge pull request #99 from americanexpress/dependabot/github_actions… #44
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
on: | |
push: | |
branches: [ main ] | |
name: Release EarlyBird | |
jobs: | |
get_next_version: | |
runs-on: ubuntu-latest | |
name: Get next version | |
outputs: | |
earlybird_next_version: ${{ steps.getversion.outputs.earlybird_next_version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
- name: Get version for next release | |
id: getversion | |
run: | | |
echo "earlybird_next_version=$(npx -p @semantic-release/changelog -p @semantic-release/git -p [email protected] semantic-release --no-ci --dry-run | grep -o 'The next release version is .*' | awk '{print $NF}')" >> $GITHUB_OUTPUT | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build: | |
needs: get_next_version | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ^1.18 | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Build project | |
run: ./build.sh ${{ needs.get_next_version.outputs.earlybird_next_version }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: earlybird-binaries | |
path: ./binaries/ | |
if-no-files-found: error | |
release: | |
needs: | |
- get_next_version | |
- build | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN}} | |
- name: Download earlybird artifacts | |
uses: actions/download-artifact@v4 | |
- name: Copy artifacts to current directory | |
run: mv earlybird-binaries/* . | |
- name: Print current directory | |
run: ls -lah | |
- name: Rename macOS binary | |
run: mv go-earlybird go-earlybird-macos | |
- name: Rename arm64 macOS binary | |
run: mv go-earlybird-arm64 go-earlybird-arm64-macos | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
- name: Create a release with Semantic Release | |
run: npx -p @semantic-release/changelog -p @semantic-release/git -p [email protected] semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |