name: Build release on: push: tags: 'v*' jobs: release: runs-on: self-hosted # root is used for testing, allow it if: secrets.ROLE == 'forgejo-integration' || github.repository_owner == 'root' steps: - uses: actions/checkout@v3 - name: Increase the verbosity when there are no secrets id: verbose run: | if test -z "${{ secrets.TOKEN }}"; then value=true else value=false fi echo "value=$value" >> "$GITHUB_OUTPUT" - name: Sanitize the name of the repository id: repository run: | set -x # comment out repository="${{ github.repository }}" echo "value=${repository##*/}" >> "$GITHUB_OUTPUT" - name: When in a test environment, create a token id: token if: ${{ secrets.TOKEN == '' }} run: | apt-get -qq install -y jq url="${{ env.GITHUB_SERVER_URL }}" hostport=${url##http*://} hostport=${hostport%%/} doer=root api=http://$doer:admin1234@$hostport/api/v1/users/$doer/tokens curl -sS -X DELETE $api/release token=$(curl -sS -X POST -H 'Content-Type: application/json' --data-raw '{"name": "release", "scopes": ["all"]}' $api | jq --raw-output .sha1) echo "value=${token}" >> "$GITHUB_OUTPUT" - uses: https://code.forgejo.org/actions/setup-go@v4 with: go-version: ">=1.20" check-latest: true - name: Create the version from ref_name id: tag-version run: | version="${{ github.ref_name }}" version=${version##*v} echo "value=$version" >> "$GITHUB_OUTPUT" - name: Create the release notes id: release-notes run: | cat >> "$GITHUB_OUTPUT" <