bump version #9
Workflow file for this run
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: | |
- master | |
- feat/initial-implementation | |
jobs: | |
build: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# - name: Generate GitHub token | |
# id: generate-token | |
# uses: actions/create-github-app-token@v1 | |
# with: | |
# app-id: ${{ vars.ACTIONS_APP_ID }} | |
# private-key: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }} | |
- name: Get version | |
id: get_version | |
run: echo "version=$(cargo read-manifest | jq -r '.version')" >> $GITHUB_OUTPUT | |
- name: Check if release exists | |
id: check_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | |
run: | | |
RELEASE_URL=$(curl --silent "https://api.github.com/repos/calimero-network/relay-server/releases/tags/${{ steps.get_version.outputs.version }}" \ | |
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "Accept: application/vnd.github.v3+json" | jq -r '.url') | |
if [[ "$RELEASE_URL" != "null" ]]; then | |
echo "exists=true" >> $GITHUB_OUTPUT | |
else | |
echo "exists=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Install cross | |
run: cargo install cross | |
if: steps.check_release.outputs.exists == 'false' | |
- name: Build for Intel Linux | |
run: cargo build --release --target=x86_64-unknown-linux-gnu | |
if: steps.check_release.outputs.exists == 'false' | |
# - name: Build for ARM Linux | |
# run: cross build --release --target=armv7-unknown-linux-gnueabihf | |
# if: steps.check_release.outputs.exists == 'false' | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
if: steps.check_release.outputs.exists == 'false' | |
with: | |
tag_name: ${{ steps.get_version.outputs.version }} | |
files: | | |
README.md | |
target/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} |