Skip to content

Commit

Permalink
build single file for sootwrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
filip-debricked committed Nov 20, 2024
1 parent d05c887 commit 262f6d6
Showing 1 changed file with 121 additions and 121 deletions.
242 changes: 121 additions & 121 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Release

on:
push:
tags:
- 'v*'
# tags:
# - 'v*'

permissions:
contents: write
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
if: needs.calculate-checksum.outputs.hash != needs.calculate-checksum.outputs.prev_hash
run: |
cd java/common/target/
zip -r soot-wrapper-${{ matrix.java-version }}.zip SootWrapper-5.1.jar // Use only the jar which includes dependencies
zip soot-wrapper-${{ matrix.java-version }}.zip SootWrapper-5.1.jar // Use only the jar which includes dependencies
mv soot-wrapper-${{ matrix.java-version }}.zip ../../../soot-wrapper-${{ matrix.java-version }}.zip
- name: Upload the archive
Expand All @@ -101,121 +101,121 @@ jobs:
path: soot-wrapper-${{ matrix.java-version }}.zip
overwrite: 'true'

goreleaser:
runs-on: ubuntu-latest
needs: soot-wrapper
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- run: git fetch --force --tags

- uses: actions/setup-go@v5
with:
go-version: '>=1.20'
cache: true

- name: Import GPG signing key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}

- name: Pull Supported Formats
run: |
cd cmd/debricked
go generate -v -x
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

- name: Download JAR archives
uses: actions/download-artifact@v4

- name: Add archives with JARs to release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ github.ref_name }}
files: |
soot-wrapper-rev-hash.txt/soot-wrapper-rev-hash.txt
soot-wrapper-11.zip/soot-wrapper-11.zip
soot-wrapper-17.zip/soot-wrapper-17.zip
soot-wrapper-21.zip/soot-wrapper-21.zip
major-release:
runs-on: ubuntu-latest
needs: goreleaser
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update major release tag
id: major-tag
run: |
# returns v1, v2, etc, everything to the left of the leftmost dot.
MAJOR_VERSION="${GITHUB_REF_NAME%%.*}"
MAJOR_TAG="release-${MAJOR_VERSION}"
echo "MAJOR_VERSION=${MAJOR_VERSION}" >> "$GITHUB_OUTPUT"
echo "MAJOR_TAG=${MAJOR_TAG}" >> "$GITHUB_OUTPUT"
git tag -f "${MAJOR_TAG}"
git push -f origin "${MAJOR_TAG}"
- name: Fetch assets from actual release
env:
MAJOR_TAG: ${{ steps.major-tag.outputs.MAJOR_TAG }}
GH_TOKEN: ${{ github.token }}
run: |
gh release download --pattern="cli_*.tar.gz" "${GITHUB_REF_NAME}"
- name: Create or update release
uses: softprops/action-gh-release@v2
with:
body: Latest release for the ${{ steps.major-tag.outputs.MAJOR_VERSION }} branch of the CLI
name: Latest ${{ steps.major-tag.outputs.MAJOR_VERSION }} CLI
tag_name: ${{ steps.major-tag.outputs.MAJOR_TAG }}
fail_on_unmatched_files: true
make_latest: false
files: "cli_*.tar.gz"


aur:
runs-on: ubuntu-latest
needs: goreleaser
container:
image: archlinux/archlinux:base-devel
steps:
- name: Prepare Arch Linux container
run: |
pacman -Syu --noconfirm git go openssh pacman-contrib
useradd -m aur
# Setup SSH access to aur.archlinux.org
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}

# Now actually clone AUR repo, and update to new version
- name: Build package and update AUR
run: |
export NEW_VERSION="${GITHUB_REF_NAME#v}"
sudo -u aur sh -c "mkdir -p /home/aur/.ssh && chmod 700 /home/aur/.ssh && touch /home/aur/.ssh/known_hosts && chmod 600 /home/aur/.ssh/known_hosts"
sudo -u aur sh -c "echo 'aur.archlinux.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuBKrPzbawxA/k2g6NcyV5jmqwJ2s+zpgZGZ7tpLIcN' >> /home/aur/.ssh/known_hosts"
mkdir -p /root/.ssh && chmod 700 /root/.ssh && cp /home/aur/.ssh/known_hosts /root/.ssh/known_hosts && chown root: /root/.ssh/known_hosts
# clone repo
git clone [email protected]:debricked.git debricked
chown -R aur debricked/
cd debricked/
sudo -u aur NEW_VERSION="${NEW_VERSION}" make update_version
sudo -u aur make package
sudo -u aur git diff
sudo -u aur git config user.email [email protected]
sudo -u aur git config user.name "Debricked build bot"
git config --global --add safe.directory "$PWD"
make push
# goreleaser:
# runs-on: ubuntu-latest
# needs: soot-wrapper
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0

# - run: git fetch --force --tags

# - uses: actions/setup-go@v5
# with:
# go-version: '>=1.20'
# cache: true

# - name: Import GPG signing key
# id: import_gpg
# uses: crazy-max/ghaction-import-gpg@v6
# with:
# gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
# passphrase: ${{ secrets.GPG_PASSPHRASE }}

# - name: Pull Supported Formats
# run: |
# cd cmd/debricked
# go generate -v -x

# - uses: goreleaser/goreleaser-action@v6
# with:
# distribution: goreleaser
# version: latest
# args: release --clean
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

# - name: Download JAR archives
# uses: actions/download-artifact@v4

# - name: Add archives with JARs to release
# uses: softprops/action-gh-release@v2
# if: startsWith(github.ref, 'refs/tags/')
# with:
# tag_name: ${{ github.ref_name }}
# files: |
# soot-wrapper-rev-hash.txt/soot-wrapper-rev-hash.txt
# soot-wrapper-11.zip/soot-wrapper-11.zip
# soot-wrapper-17.zip/soot-wrapper-17.zip
# soot-wrapper-21.zip/soot-wrapper-21.zip

# major-release:
# runs-on: ubuntu-latest
# needs: goreleaser
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Update major release tag
# id: major-tag
# run: |
# # returns v1, v2, etc, everything to the left of the leftmost dot.
# MAJOR_VERSION="${GITHUB_REF_NAME%%.*}"
# MAJOR_TAG="release-${MAJOR_VERSION}"
# echo "MAJOR_VERSION=${MAJOR_VERSION}" >> "$GITHUB_OUTPUT"
# echo "MAJOR_TAG=${MAJOR_TAG}" >> "$GITHUB_OUTPUT"
# git tag -f "${MAJOR_TAG}"
# git push -f origin "${MAJOR_TAG}"
# - name: Fetch assets from actual release
# env:
# MAJOR_TAG: ${{ steps.major-tag.outputs.MAJOR_TAG }}
# GH_TOKEN: ${{ github.token }}
# run: |
# gh release download --pattern="cli_*.tar.gz" "${GITHUB_REF_NAME}"
# - name: Create or update release
# uses: softprops/action-gh-release@v2
# with:
# body: Latest release for the ${{ steps.major-tag.outputs.MAJOR_VERSION }} branch of the CLI
# name: Latest ${{ steps.major-tag.outputs.MAJOR_VERSION }} CLI
# tag_name: ${{ steps.major-tag.outputs.MAJOR_TAG }}
# fail_on_unmatched_files: true
# make_latest: false
# files: "cli_*.tar.gz"


# aur:
# runs-on: ubuntu-latest
# needs: goreleaser
# container:
# image: archlinux/archlinux:base-devel
# steps:
# - name: Prepare Arch Linux container
# run: |
# pacman -Syu --noconfirm git go openssh pacman-contrib
# useradd -m aur

# # Setup SSH access to aur.archlinux.org
# - uses: webfactory/[email protected]
# with:
# ssh-private-key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}

# # Now actually clone AUR repo, and update to new version
# - name: Build package and update AUR
# run: |
# export NEW_VERSION="${GITHUB_REF_NAME#v}"
# sudo -u aur sh -c "mkdir -p /home/aur/.ssh && chmod 700 /home/aur/.ssh && touch /home/aur/.ssh/known_hosts && chmod 600 /home/aur/.ssh/known_hosts"
# sudo -u aur sh -c "echo 'aur.archlinux.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuBKrPzbawxA/k2g6NcyV5jmqwJ2s+zpgZGZ7tpLIcN' >> /home/aur/.ssh/known_hosts"
# mkdir -p /root/.ssh && chmod 700 /root/.ssh && cp /home/aur/.ssh/known_hosts /root/.ssh/known_hosts && chown root: /root/.ssh/known_hosts
# # clone repo
# git clone [email protected]:debricked.git debricked
# chown -R aur debricked/
# cd debricked/
# sudo -u aur NEW_VERSION="${NEW_VERSION}" make update_version
# sudo -u aur make package
# sudo -u aur git diff
# sudo -u aur git config user.email [email protected]
# sudo -u aur git config user.name "Debricked build bot"
# git config --global --add safe.directory "$PWD"
# make push

0 comments on commit 262f6d6

Please sign in to comment.