forked from go-gitea/gitea
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: (33 commits) Bump webpack from 5.75.0 to 5.76.0 (go-gitea#23484) Replace Less with CSS (go-gitea#23481) Fix 'View File' button in code search (go-gitea#23478) Use `gitea/test_env` image instead of `golang` (go-gitea#23455) Skip DB tests duplicate runs on push to branches (go-gitea#23476) Update app.example.ini (go-gitea#23480) [skip ci] Updated translations via Crowdin Fix due date being wrong on issue list (go-gitea#23475) test_env: hardcode major go version in use (go-gitea#23464) Push option bonus for PTC docs (go-gitea#23473) Lint Markdown pass Push to create docs (go-gitea#23458) Convert GitHub event on actions and fix some pull_request events. (go-gitea#23037) Remove wrongly added column on migration test fixtures (go-gitea#23456) Refactor branch/tag selector to Vue SFC (go-gitea#23421) add admin API email endpoints (go-gitea#22792) add user rename endpoint to admin api (go-gitea#22789) Add workflow error notification in ui (go-gitea#23404) Make branches list page operations remember current page (go-gitea#23420) fix markdown lint issue (go-gitea#23457) ...
- Loading branch information
Showing
231 changed files
with
11,841 additions
and
9,299 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
--- | ||
date: "2023-01-10T00:00:00+00:00" | ||
title: "Swift Packages Repository" | ||
slug: "packages/swift" | ||
draft: false | ||
toc: false | ||
menu: | ||
sidebar: | ||
parent: "packages" | ||
name: "Swift" | ||
weight: 95 | ||
identifier: "swift" | ||
--- | ||
|
||
# Swift Packages Repository | ||
|
||
Publish [Swift](hhttps://www.swift.org/) packages for your user or organization. | ||
|
||
**Table of Contents** | ||
|
||
{{< toc >}} | ||
|
||
## Requirements | ||
|
||
To work with the Swift package registry, you need to use [swift](https://www.swift.org/getting-started/) to consume and a HTTP client (like `curl`) to publish packages. | ||
|
||
## Configuring the package registry | ||
|
||
To register the package registry and provide credentials, execute: | ||
|
||
```shell | ||
swift package-registry set https://gitea.example.com/api/packages/{owner}/swift -login {username} -password {password} | ||
``` | ||
|
||
| Placeholder | Description | | ||
| ------------ | ----------- | | ||
| `owner` | The owner of the package. | | ||
| `username` | Your Gitea username. | | ||
| `password` | Your Gitea password. If you are using 2FA or OAuth use a [personal access token]({{< relref "doc/developers/api-usage.en-us.md#authentication" >}}) instead of the password. | | ||
|
||
The login is optional and only needed if the package registry is private. | ||
|
||
## Publish a package | ||
|
||
First you have to pack the contents of your package: | ||
|
||
```shell | ||
swift package archive-source | ||
``` | ||
|
||
To publish the package perform a HTTP PUT request with the package content in the request body. | ||
|
||
```shell --user your_username:your_password_or_token \ | ||
curl -X PUT --user {username}:{password} \ | ||
-H "Accept: application/vnd.swift.registry.v1+json" \ | ||
-F source-archive=@/path/to/package.zip \ | ||
-F metadata={metadata} \ | ||
https://gitea.example.com/api/packages/{owner}/swift/{scope}/{name}/{version} | ||
``` | ||
|
||
| Placeholder | Description | | ||
| ----------- | ----------- | | ||
| `username` | Your Gitea username. | | ||
| `password` | Your Gitea password. If you are using 2FA or OAuth use a [personal access token]({{< relref "doc/developers/api-usage.en-us.md#authentication" >}}) instead of the password. | | ||
| `owner` | The owner of the package. | | ||
| `scope` | The package scope. | | ||
| `name` | The package name. | | ||
| `version` | The package version. | | ||
| `metadata` | (Optional) The metadata of the package. JSON encoded subset of https://schema.org/SoftwareSourceCode | | ||
|
||
You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. | ||
|
||
## Install a package | ||
|
||
To install a Swift package from the package registry, add it in the `Package.swift` file dependencies list: | ||
|
||
``` | ||
dependencies: [ | ||
.package(id: "{scope}.{name}", from:"{version}") | ||
] | ||
``` | ||
|
||
| Parameter | Description | | ||
| ----------- | ----------- | | ||
| `scope` | The package scope. | | ||
| `name` | The package name. | | ||
| `version` | The package version. | | ||
|
||
Afterwards execute the following command to install it: | ||
|
||
```shell | ||
swift package resolve | ||
``` |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
date: "2020-07-06T16:00:00+02:00" | ||
title: "Usage: Push To Create" | ||
slug: "push-to-create" | ||
weight: 15 | ||
toc: false | ||
draft: false | ||
menu: | ||
sidebar: | ||
parent: "usage" | ||
name: "Push To Create" | ||
weight: 15 | ||
identifier: "push-to-create" | ||
--- | ||
|
||
# Push To Create | ||
|
||
Push to create is a feature that allows you to push to a repository that does not exist yet in Gitea. This is useful for automation and for allowing users to create repositories without having to go through the web interface. This feature is disabled by default. | ||
|
||
## Enabling Push To Create | ||
|
||
In the `app.ini` file, set `ENABLE_PUSH_CREATE_USER` to `true` and `ENABLE_PUSH_CREATE_ORG` to `true` if you want to allow users to create repositories in their own user account and in organizations they are a member of respectively. Restart Gitea for the changes to take effect. You can read more about these two options in the [Configuration Cheat Sheet]({{< relref "doc/advanced/config-cheat-sheet.en-us.md#repository-repository" >}}). | ||
|
||
## Using Push To Create | ||
|
||
Assuming you have a git repository in the current directory, you can push to a repository that does not exist yet in Gitea by running the following command: | ||
|
||
```shell | ||
# Add the remote you want to push to | ||
git remote add origin git@{domain}:{username}/{repo name that does not exist yet}.git | ||
|
||
# push to the remote | ||
git push -u origin main | ||
``` | ||
|
||
This assumes you are using an SSH remote, but you can also use HTTPS remotes as well. | ||
|
||
## Push options (bonus) | ||
|
||
Push-to-create will default to the visibility defined by `DEFAULT_PUSH_CREATE_PRIVATE` in `app.ini`. To explicitly set the visibility, you can use a [push option]({{< relref "doc/usage/push-options.en-us.md" >}}). |
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
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
Oops, something went wrong.