|
| 1 | +name: release-nightly-assets |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main, release/v* ] |
| 6 | + |
| 7 | +jobs: |
| 8 | + nightly-binary: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v3 |
| 12 | + # fetch all commits instead of only the last as some branches are long lived and could have many between versions |
| 13 | + # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 |
| 14 | + - run: git fetch --unshallow --quiet --tags --force |
| 15 | + - uses: actions/setup-go@v4 |
| 16 | + with: |
| 17 | + go-version: ">=1.20" |
| 18 | + check-latest: true |
| 19 | + - uses: actions/setup-node@v3 |
| 20 | + with: |
| 21 | + node-version: 20 |
| 22 | + - run: make deps-frontend deps-backend |
| 23 | + # xgo build |
| 24 | + - run: make release |
| 25 | + env: |
| 26 | + TAGS: bindata sqlite sqlite_unlock_notify |
| 27 | + - name: import gpg key |
| 28 | + id: import_gpg |
| 29 | + uses: crazy-max/ghaction-import-gpg@v5 |
| 30 | + with: |
| 31 | + gpg_private_key: ${{ secrets.GPGSIGN_KEY }} |
| 32 | + passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }} |
| 33 | + - name: sign binaries |
| 34 | + run: | |
| 35 | + for f in dist/release/*; do |
| 36 | + echo '${{ secrets.GPGSIGN_PASSPHRASE }}' | gpg --pinentry-mode loopback --passphrase-fd 0 --batch --yes --detach-sign -u ${{ steps.import_gpg.outputs.fingerprint }} --output "$f.asc" "$f" |
| 37 | + done |
| 38 | + # clean branch name to get the folder name in S3 |
| 39 | + - name: Get cleaned branch name |
| 40 | + id: clean_name |
| 41 | + run: | |
| 42 | + REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//') |
| 43 | + echo "Cleaned name is ${REF_NAME}" |
| 44 | + echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT" |
| 45 | + - name: upload binaries to s3 |
| 46 | + uses: jakejarvis/s3-sync-action@master |
| 47 | + env: |
| 48 | + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} |
| 49 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 50 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 51 | + AWS_REGION: ${{ secrets.AWS_REGION }} |
| 52 | + SOURCE_DIR: dist/release |
| 53 | + DEST_DIR: gitea/${{ steps.clean_name.outputs.branch }} |
| 54 | + nightly-docker: |
| 55 | + runs-on: ubuntu-latest |
| 56 | + steps: |
| 57 | + - uses: actions/checkout@v3 |
| 58 | + - uses: docker/setup-buildx-action@v1 |
| 59 | + # build for linux/amd64, and linux/arm64 (possibly include linux/arm/v7 later. not included now because it adds significant amount to the build time) |
0 commit comments