Fix Github Actions workflow #23
This file contains hidden or 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 Go Binary | ||
| on: | ||
| push: | ||
| tags: | ||
| - "v*" | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - run: sudo apt install golang curl jq git | ||
| - run: git clone https://github.com/verdigado/pfa-ldap-auth.git | ||
| - run: bash -c "cd pfa-ldap-auth; go get ." | ||
| - run: bash -c "cd pfa-ldap-auth; go build ." | ||
| - run: 'export RESPONSE=$(curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/verdigado/pfa-ldap-auth/releases -d "{\"tag_name\":\"${{ github.ref }}\",\"target_commitish\":\"master\",\"name\":\"${{ github.ref }}\",\"body\":\"Version ${{ github.ref }}\",\"draft\":false,\"prerelease\":false,\"generate_release_notes\":false}")' | ||
| - run: export RELEASE_ID=$(echo "$RESPONSE" | jq .id) | ||
| - run: echo "Attaching file to release $RELEASE_ID" | ||
| - run: ls -lah pfa-ldap-auth/pfa-ldap-auth | ||
| - run: curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "Content-Type: application/octet-stream" --data-binary @"pfa-ldap-auth/pfa-ldap-auth" "https://uploads.github.com/repos/verdigado/pfa-ldap-auth/releases/$RELEASE_ID/assets?name=pfa-ldap-auth" | ||
| - run: echo "Finished" | ||