Build and Release on Push to Master #3
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: Build and Release on Push to Master | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: [Test] | |
types: [completed] | |
branches: | |
- master | |
- zerosessionidfix | |
- lastsigninatfix | |
jobs: | |
release: | |
outputs: | |
status: ${{ steps.semantic.outputs.new_release_published }} | |
version: ${{ steps.semantic.outputs.new_release_version }} | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Release on GitHub | |
id: semantic | |
uses: cycjimmy/semantic-release-action@v3 | |
with: | |
semantic_version: 18 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
deploy: | |
needs: release | |
runs-on: ubuntu-20.04 | |
if: success() && needs.release.outputs.status == 'true' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: "^1.21.0" # The Go version to download (if necessary) and use. | |
- run: make deps | |
- run: make all | |
- run: tar -czvf gotrue-v${{ needs.release.outputs.version }}-x86.tar.gz gotrue migrations/ | |
- run: mv gotrue-arm64 gotrue | |
- run: tar -czvf gotrue-v${{ needs.release.outputs.version }}-arm64.tar.gz gotrue migrations/ | |
- uses: AButler/[email protected] | |
with: | |
files: "gotrue-v${{ needs.release.outputs.version }}*.tar.gz" | |
release-tag: v${{ needs.release.outputs.version }} | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
publish: | |
needs: | |
- release | |
if: success() && needs.release.outputs.status == 'true' | |
# Call publish explicitly because events from actions cannot trigger more actions | |
uses: ./.github/workflows/publish.yml | |
with: | |
version: v${{ needs.release.outputs.version }} | |
secrets: inherit |