-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from gustawdaniel/2-publish-in-system-reposito…
…ries 2 publish in system repositories
- Loading branch information
Showing
6 changed files
with
417 additions
and
110 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -6,19 +6,85 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
# snap: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - name: Install shunit | ||
# run: sudo apt install -y shunit2 | ||
# - uses: snapcore/action-build@v1 | ||
# id: snapcraft | ||
# - uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: snap | ||
# path: ${{ steps.snapcraft.outputs.snap }} | ||
# - run: | | ||
# sudo snap install --dangerous ${{ steps.snapcraft.outputs.snap }} --classic | ||
# - run: alias p=gpt-cli | ||
# - run: ./test_version.sh | ||
# debug: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - name: Install nFPM | ||
# run: | | ||
# echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list | ||
# sudo apt update | ||
# sudo apt install -y nfpm shunit2 xorg-dev libxcb-composite0-dev | ||
# - run: cargo build --release | ||
# - run: nfpm pkg --packager deb --target target | ||
# - run: sudo apt install ./target/gpt-cli_0.0.16_amd64.deb | ||
# - run: ./test_version.sh | ||
deb-rpm: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install shunit | ||
run: sudo apt install -y shunit2 | ||
- uses: snapcore/action-build@v1 | ||
id: snapcraft | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: snap | ||
path: ${{ steps.snapcraft.outputs.snap }} | ||
- run: | | ||
sudo snap install --dangerous ${{ steps.snapcraft.outputs.snap }} --classic | ||
- run: alias p=gpt-cli | ||
- run: ./test_version.sh | ||
- name: Install nFPM | ||
run: | | ||
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list | ||
sudo apt update | ||
sudo apt install -y nfpm shunit2 xorg-dev libxcb-composite0-dev | ||
- run: cargo build --release | ||
- name: Get release information | ||
run: | | ||
RELEASE_TAG=$(echo "v0.0.17" | sed "s|v||") | ||
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV | ||
- name: Update fallback release URL | ||
run: | | ||
sed -i "s|version: .*|version: \"${{ env.RELEASE_TAG }}\"|" nfpm.yaml | ||
# - name: Commit changes | ||
# uses: EndBug/add-and-commit@v9 | ||
# with: | ||
# author_name: Daniel Gustaw | ||
# author_email: [email protected] | ||
# message: "updated nfpm.yaml version to ${{ env.RELEASE_TAG }}" | ||
# add: 'nfpm.yaml' | ||
# push: origin HEAD:main | ||
# tag_push: '--force' | ||
|
||
- run: cat nfpm.yaml | ||
- run: nfpm pkg --packager deb --target target | ||
- run: ls -la target | ||
- run: sudo apt install ./target/gpt-cli_${{ env.RELEASE_TAG }}_amd64.deb | ||
- run: ./test_version.sh | ||
- run: nfpm pkg --packager rpm --target target | ||
- run: nfpm pkg --packager archlinux --target target | ||
- name: Compute shasums | ||
run: | | ||
mv ./target/gpt-cli_${{ env.RELEASE_TAG }}_amd64.deb gpt-cli_amd64.deb | ||
mv ./target/gpt-cli-${{ env.RELEASE_TAG }}.x86_64.rpm gpt-cli.x86_64.rpm | ||
mv ./target/gpt-cli-${{ env.RELEASE_TAG }}-1-x86_64.pkg.tar.zst gpt-cli-x86_64.pkg.tar.zst | ||
shasum -a 256 gpt-cli_amd64.deb | cut -d " " -f 1 > gpt-cli_amd64.deb.sha256.txt | ||
shasum -a 256 gpt-cli.x86_64.rpm | cut -d " " -f 1 > gpt-cli.x86_64.rpm.sha256.txt | ||
- run: ls -la | ||
# - name: Release | ||
# uses: softprops/action-gh-release@v1 | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
# with: | ||
# files: | | ||
# gpt-cli_amd64.deb | ||
# gpt-cli.x86_64.rpm | ||
# gpt-cli_amd64.deb.sha256.txt | ||
# gpt-cli.x86_64.rpm.sha256.txt | ||
# gpt-cli-x86_64.pkg.tar.zst |
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 |
---|---|---|
|
@@ -48,7 +48,6 @@ jobs: | |
- name: Get release information | ||
run: | | ||
RELEASE_TAG=$(echo ${{ github.event.release.tag_name }} | sed "s|v||") | ||
echo "Release tag: $RELEASE_TAG" | ||
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV | ||
- name: Use release information | ||
run: | | ||
|
@@ -148,3 +147,81 @@ jobs: | |
- run: cargo publish | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
|
||
deb-rpm: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install nFPM | ||
run: | | ||
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list | ||
sudo apt update | ||
sudo apt install -y nfpm shunit2 xorg-dev libxcb-composite0-dev | ||
- run: cargo build --release | ||
- name: Get release information | ||
run: | | ||
RELEASE_TAG=$(echo "v0.0.17" | sed "s|v||") | ||
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV | ||
- name: Update fallback release URL | ||
run: | | ||
sed -i "s|version: .*|version: \"${{ env.RELEASE_TAG }}\"|" nfpm.yaml | ||
- name: Commit changes | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
author_name: Daniel Gustaw | ||
author_email: [email protected] | ||
message: "updated nfpm.yaml version to ${{ env.RELEASE_TAG }}" | ||
add: 'nfpm.yaml' | ||
push: origin HEAD:main | ||
tag_push: '--force' | ||
|
||
- run: cat nfpm.yaml | ||
- run: nfpm pkg --packager deb --target target | ||
- run: ls -la target | ||
- run: sudo apt install ./target/gpt-cli_${{ env.RELEASE_TAG }}_amd64.deb | ||
- run: ./test_version.sh | ||
- run: nfpm pkg --packager rpm --target target | ||
- run: nfpm pkg --packager archlinux --target target | ||
- name: Compute shasums | ||
run: | | ||
mv ./target/gpt-cli_${{ env.RELEASE_TAG }}_amd64.deb gpt-cli_amd64.deb | ||
mv ./target/gpt-cli-${{ env.RELEASE_TAG }}.x86_64.rpm gpt-cli.x86_64.rpm | ||
mv ./target/gpt-cli-${{ env.RELEASE_TAG }}-1-x86_64.pkg.tar.zst gpt-cli-x86_64.pkg.tar.zst | ||
shasum -a 256 gpt-cli_amd64.deb | cut -d " " -f 1 > gpt-cli_amd64.deb.sha256.txt | ||
shasum -a 256 gpt-cli.x86_64.rpm | cut -d " " -f 1 > gpt-cli.x86_64.rpm.sha256.txt | ||
- run: ls -la | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
with: | ||
files: | | ||
gpt-cli_amd64.deb | ||
gpt-cli.x86_64.rpm | ||
gpt-cli_amd64.deb.sha256.txt | ||
gpt-cli.x86_64.rpm.sha256.txt | ||
gpt-cli-x86_64.pkg.tar.zst | ||
snap: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install shunit | ||
run: sudo apt install -y shunit2 | ||
- uses: snapcore/action-build@v1 | ||
id: snapcraft | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: snap | ||
path: ${{ steps.snapcraft.outputs.snap }} | ||
- run: | | ||
sudo snap install --dangerous ${{ steps.snapcraft.outputs.snap }} --classic | ||
- run: alias p=gpt-cli | ||
- run: ./test_version.sh | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
with: | ||
files: | | ||
${{ steps.snapcraft.outputs.snap }} |
Oops, something went wrong.